Versions in this module Expand all Collapse all v0 v0.3.5 Jul 10, 2026 v0.3.4 Jul 10, 2026 Changes in this version + var ErrIntegrity = errors.New("configsync: snapshot integrity mismatch") + var ErrLKGCorrupt = errors.New("configsync: last-known-good snapshot is corrupt") + var ErrNotReady = errors.New("configsync: snapshot not ready") + var ErrReadOnly = errors.New("configsync: store is read-only") + var ErrTransportUnavailable = errors.New("configsync: transport unavailable") + func ReadinessCheck[T any](store ConfigStore[T]) func(context.Context) error + type AESGCMCrypto struct + func NewAESGCMCrypto(key []byte) (*AESGCMCrypto, error) + func (c *AESGCMCrypto) Decrypt(ciphertext []byte) ([]byte, error) + func (c *AESGCMCrypto) Encrypt(plaintext []byte) ([]byte, error) + type ConfigFetcher interface + Fetch func(ctx context.Context, etag string) (raw []byte, version string, notModified bool, err error) + type ConfigStore interface + Load func() (*Versioned[T], bool) + Swap func(v *Versioned[T]) + Version func() string + type Crypto interface + Decrypt func(ciphertext []byte) ([]byte, error) + Encrypt func(plaintext []byte) ([]byte, error) + type LKGStore struct + func NewLKGStore[T any](crypto Crypto, codec SnapshotCodec[T], path string) *LKGStore[T] + func (s *LKGStore[T]) Age() (time.Duration, bool) + func (s *LKGStore[T]) Load() (*Versioned[T], error) + func (s *LKGStore[T]) Persist(v *Versioned[T]) error + type MemoryStore struct + func NewMemoryStore[T any]() *MemoryStore[T] + func (s *MemoryStore[T]) Load() (*Versioned[T], bool) + func (s *MemoryStore[T]) Swap(v *Versioned[T]) + func (s *MemoryStore[T]) Version() string + type SnapshotCodec interface + Decode func(raw []byte) (T, error) + Encode func(snapshot T) (raw []byte, err error) + Version func(raw []byte) string + type StreamTransport interface + Ack func(ctx context.Context, appliedVersion string) error + Watch func(ctx context.Context) (version string, err error) + type Versioned struct + Raw []byte + Snapshot T + Version string + type Worker struct + func NewWorker[T any](fetcher ConfigFetcher, store ConfigStore[T], transport StreamTransport, ...) *Worker[T] + func (w *Worker[T]) Converge(ctx context.Context) error + func (w *Worker[T]) Run(ctx context.Context) error + type WorkerConfig struct + MaxBackoff time.Duration + MinBackoff time.Duration + PollInterval time.Duration + type WorkerOption func(*Worker[T]) + func WithOnApplied[T any](fn func(context.Context)) WorkerOption[T]