core

package
v0.0.179 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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.

View Source
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

func WithDeduplication(ttl time.Duration, maxMessages int) Option

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

func WithMaxMessageBytes(n int64) Option

WithMaxMessageBytes bounds one websocket message this side reads, over all its frames; zero or less keeps DefaultMaxMessageBytes.

func WithReadTimeout added in v0.0.173

func WithReadTimeout(d time.Duration) Option

WithReadTimeout bounds the wait for the next frame; zero or less waits forever.

type Synchronizer

type Synchronizer struct {
	Conn *net.Conn
	// contains filtered or unexported fields
}

func NewSynchronizerClient

func NewSynchronizerClient(mainCtx context.Context, adapter []adapters.Adapter, conn net.Conn, newConn func() (net.Conn, error), opts ...Option) (*Synchronizer, error)

func NewSynchronizerServer

func NewSynchronizerServer(mainCtx context.Context, adapter []adapters.Adapter, conn net.Conn, opts ...Option) (*Synchronizer, error)

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

func (*Synchronizer) DeleteObjectCallback

func (s *Synchronizer) DeleteObjectCallback(ctx context.Context, id domain.KindName) error

func (*Synchronizer) GetObjectCallback

func (s *Synchronizer) GetObjectCallback(ctx context.Context, id domain.KindName, baseObject []byte) error

func (*Synchronizer) PatchObjectCallback

func (s *Synchronizer) PatchObjectCallback(ctx context.Context, id domain.KindName, checksum string, patch []byte) error

func (*Synchronizer) PutObjectCallback

func (s *Synchronizer) PutObjectCallback(ctx context.Context, id domain.KindName, checksum string, object []byte) error

func (*Synchronizer) Start

func (s *Synchronizer) Start(ctx context.Context) error

func (*Synchronizer) Stop added in v0.0.38

func (s *Synchronizer) Stop(ctx context.Context) error

func (*Synchronizer) VerifyObjectCallback

func (s *Synchronizer) VerifyObjectCallback(ctx context.Context, id domain.KindName, checksum string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL