Documentation ¶
Index ¶
- Variables
- func DataSrcContext(ctx context.Context, dataSrc string) context.Context
- func DataSrcFromContext(ctx context.Context) (dataSrc string, ok bool)
- type Deps
- type Dispatcher
- type KVPairs
- type KVStore
- type KeyVal
- type Option
- type Plugin
- func (p *Plugin) AfterInit() (err error)
- func (p Plugin) GetStatus(key string) (*Status, error)
- func (p *Plugin) Init() (err error)
- func (p *Plugin) InitialSync()
- func (p Plugin) ListData() KVPairs
- func (p Plugin) ListState() (KVPairs, error)
- func (p Plugin) PushData(ctx context.Context, kvPairs []KeyVal) (results []Result, err error)
- type Result
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPlugin = *NewPlugin()
DefaultPlugin is default instance of Plugin
Functions ¶
Types ¶
type Deps ¶
type Deps struct { infra.PluginDeps GRPC grpc.Server KVScheduler kvs.KVScheduler Watcher datasync.KeyValProtoWatcher StatusPublisher datasync.KeyProtoValWriter }
Deps represents dependencies for the plugin.
type Dispatcher ¶
type KVStore ¶
type KVStore interface { ListAll() KVPairs List(dataSrc string) KVPairs Update(dataSrc, key string, val proto.Message) Delete(dataSrc, key string) Reset(dataSrc string) }
KVStore describes an interface for key-value store used by dispatcher.
type KeyVal ¶
KeyVal associates value with its key.
type Option ¶
type Option func(*Plugin)
Option is a function that acts on a Plugin to inject Dependencies or configuration
type Plugin ¶
type Plugin struct { Deps // contains filtered or unexported fields }
Plugin implements sync service for GRPC.
func NewPlugin ¶
NewPlugin creates a new Plugin with the provides Options
func (*Plugin) AfterInit ¶
AfterInit subscribes to known NB prefixes.
func (*Plugin) Init ¶
Init registers the service to GRPC server.
func (*Plugin) InitialSync ¶
func (p *Plugin) InitialSync()
InitialSync will start initial synchronization with downstream.
func (Plugin) ListState ¶
ListState retrieves running state.
type Status ¶
type Status = kvs.ValueStatus
Source Files ¶
Click to show internal directories.
Click to hide internal directories.