Documentation
¶
Index ¶
- Constants
- type Option
- type Synchronizer
- func (s *Synchronizer) BatchCallback(ctx context.Context, kind domain.Kind, batchType domain.BatchType, ...) error
- func (s *Synchronizer) DeleteObjectCallback(ctx context.Context, id domain.KindName) error
- func (s *Synchronizer) GetObjectCallback(ctx context.Context, id domain.KindName, baseObject []byte) error
- func (s *Synchronizer) PatchObjectCallback(ctx context.Context, id domain.KindName, checksum string, patch []byte) error
- func (s *Synchronizer) PutObjectCallback(ctx context.Context, id domain.KindName, checksum string, object []byte) error
- func (s *Synchronizer) Start(ctx context.Context) error
- func (s *Synchronizer) Stop(ctx context.Context) error
- func (s *Synchronizer) VerifyObjectCallback(ctx context.Context, id domain.KindName, checksum string) error
Constants ¶
const ( AccessKeyHeader = "X-API-KEY" AccountHeader = "X-API-ACCOUNT" ClusterNameHeader = "X-API-CLUSTER" HelmVersionHeader = "X-HELM-VERSION" VersionHeader = "X-SYNCHRONIZER-VERSION" GitVersionHeader = "X-GIT-VERSION" CloudProviderHeader = "X-CLOUD-PROVIDER" ClusterUIDHeader = "X-CLUSTER-UID" ResourceGroupHeader = "X-RESOURCE-GROUP" )
These headers are required for client-server authentication
const DefaultMaxMessageBytes = 64 << 20
DefaultMaxMessageBytes bounds one websocket message when no limit is configured: the backend's Kafka producer carries 64 MiB by default, and a deployment that raises that limit raises this one through WithMaxMessageBytes on both ends.
const DefaultServerReadTimeout = 2 * time.Minute
DefaultServerReadTimeout is how long a server waits for the next frame from a client before it ends the connection: the client sends a ping every 50 seconds, so a connection silent for this long belongs to a peer that is gone without closing it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.0.173
type Option func(*options)
Option configures a synchronizer.
func WithDeduplication ¶ added in v0.0.179
WithDeduplication bounds successful backend-message fingerprints on the client. A nonpositive limit or duration disables deduplication. It has no server effect.
func WithMaxMessageBytes ¶ added in v0.0.173
WithMaxMessageBytes bounds one websocket message this side reads, over all its frames; zero or less keeps DefaultMaxMessageBytes.
func WithReadTimeout ¶ added in v0.0.173
WithReadTimeout bounds the wait for the next frame; zero or less waits forever.
type Synchronizer ¶
func NewSynchronizerClient ¶
func NewSynchronizerServer ¶
func (*Synchronizer) BatchCallback ¶ added in v0.0.47
func (s *Synchronizer) BatchCallback(ctx context.Context, kind domain.Kind, batchType domain.BatchType, items domain.BatchItems) error