sync

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISyncService

type ISyncService interface {
	// Start the sync service
	Start(context.Context) error

	// Emit updates for sync listeners
	Emit(isResync bool, source string)
}

type Multiplexer

type Multiplexer struct {
	// contains filtered or unexported fields
}

Multiplexer abstract subscription handling and storage processing. Flag configurations will be lazy loaded using reFill logic upon the calls to publish.

func NewMux

func NewMux(store *store.Flags, sources []string) (*Multiplexer, error)

NewMux creates a new sync multiplexer

func (*Multiplexer) GetAllFlags

func (r *Multiplexer) GetAllFlags(source string) (string, error)

GetAllFlags per specific source

func (*Multiplexer) Publish

func (r *Multiplexer) Publish() error

Publish sync updates to subscriptions

func (*Multiplexer) Register

func (r *Multiplexer) Register(id interface{}, source string, con chan payload) error

Register a subscription

func (*Multiplexer) SourcesAsMetadata

func (r *Multiplexer) SourcesAsMetadata() string

SourcesAsMetadata returns all known sources, comma separated to be used as service metadata

func (*Multiplexer) Unregister

func (r *Multiplexer) Unregister(id interface{}, selector string)

Unregister a subscription

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewSyncService

func NewSyncService(cfg SvcConfigurations) (*Service, error)

func (*Service) Emit

func (s *Service) Emit(isResync bool, source string)

func (*Service) Start

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

type SvcConfigurations

type SvcConfigurations struct {
	Logger  *logger.Logger
	Port    uint16
	Sources []string
	Store   *store.Flags
}

Jump to

Keyboard shortcuts

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