store

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISyncStore added in v0.5.4

type ISyncStore interface {
	FetchAllFlags(
		ctx context.Context,
		key interface{},
		target string,
	) (isync.DataSync, error)
	RegisterSubscription(
		ctx context.Context,
		target string,
		key interface{},
		dataSync chan isync.DataSync,
		errChan chan error,
	)

	// metrics hooks
	GetActiveSubscriptionsInt64() int64
}

ISyncStore defines the interface for the sync store

type SyncBuilder

type SyncBuilder struct{}

func (*SyncBuilder) SyncFromURI

func (sb *SyncBuilder) SyncFromURI(uri string, logger *logger.Logger) (isync.ISync, error)

SyncFromURI builds an ISync interface from the input uri string

type SyncBuilderInterface

type SyncBuilderInterface interface {
	SyncFromURI(uri string, logger *logger.Logger) (isync.ISync, error)
}

type SyncStore

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

func NewSyncStore

func NewSyncStore(ctx context.Context, logger *logger.Logger) *SyncStore

NewSyncStore returns a new sync store

func (*SyncStore) FetchAllFlags

func (s *SyncStore) FetchAllFlags(ctx context.Context, key interface{}, target string) (isync.DataSync, error)

FetchAllFlags returns a DataSync containing the full set of flag configurations from the SyncStore. This will either occur via triggering a resync, or through setting up a new subscription to the resource

func (*SyncStore) GetActiveSubscriptionsInt64 added in v0.5.0

func (s *SyncStore) GetActiveSubscriptionsInt64() int64

func (*SyncStore) RegisterSubscription

func (s *SyncStore) RegisterSubscription(
	ctx context.Context,
	target string,
	key interface{},
	dataSync chan isync.DataSync,
	errChan chan error,
)

RegisterSubscription starts a new subscription to the target resource. Once the subscription is set an ALL sync event will be received via the DataSync chan.

Jump to

Keyboard shortcuts

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