Documentation
¶
Overview ¶
Package synchronizer synchronizes configurations down to devices
Index ¶
- func WithDeviceChangeStore(deviceChangeStore device.Store) func(*Factory)
- func WithDispatcher(dispatcher *dispatcher.Dispatcher) func(*Factory)
- func WithModelRegistry(modelRegistry *modelregistry.ModelRegistry) func(*Factory)
- func WithNewTargetFn(newTargetFn func() southbound.TargetIf) func(*Factory)
- func WithOpStateChannel(opStateChan chan<- events.OperationalStateEvent) func(*Factory)
- func WithOperationalStateCache(operationalStateCache map[topodevice.ID]devicechange.TypedValueMap) func(*Factory)
- func WithOperationalStateCacheLock(operationalStateCacheLock *syncPrimitives.RWMutex) func(*Factory)
- func WithSouthboundErrChan(southboundErrorChan chan<- events.DeviceResponse) func(*Factory)
- func WithTopoChannel(topoChannel <-chan *topodevice.ListResponse) func(*Factory)
- type Factory
- type Synchronizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDeviceChangeStore ¶ added in v0.6.12
WithDeviceChangeStore sets factory device change store
func WithDispatcher ¶ added in v0.6.12
func WithDispatcher(dispatcher *dispatcher.Dispatcher) func(*Factory)
WithDispatcher sets factory dispatcher
func WithModelRegistry ¶ added in v0.6.12
func WithModelRegistry(modelRegistry *modelregistry.ModelRegistry) func(*Factory)
WithModelRegistry set factory model registry
func WithNewTargetFn ¶ added in v0.6.12
func WithNewTargetFn(newTargetFn func() southbound.TargetIf) func(*Factory)
WithNewTargetFn sets factory southbound target function
func WithOpStateChannel ¶ added in v0.6.12
func WithOpStateChannel(opStateChan chan<- events.OperationalStateEvent) func(*Factory)
WithOpStateChannel sets factory opStateChannel
func WithOperationalStateCache ¶ added in v0.6.12
func WithOperationalStateCache(operationalStateCache map[topodevice.ID]devicechange.TypedValueMap) func(*Factory)
WithOperationalStateCache sets factory operational state cache
func WithOperationalStateCacheLock ¶ added in v0.6.12
func WithOperationalStateCacheLock(operationalStateCacheLock *syncPrimitives.RWMutex) func(*Factory)
WithOperationalStateCacheLock sets factory operational state cache lock
func WithSouthboundErrChan ¶ added in v0.6.12
func WithSouthboundErrChan(southboundErrorChan chan<- events.DeviceResponse) func(*Factory)
WithSouthboundErrChan sets factory southbound error channel
func WithTopoChannel ¶ added in v0.6.12
func WithTopoChannel(topoChannel <-chan *topodevice.ListResponse) func(*Factory)
WithTopoChannel sets factory topo channel
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory device factory data structures
func NewFactory ¶ added in v0.6.12
NewFactory create a new factory
func (*Factory) TopoEventHandler ¶ added in v0.6.12
func (f *Factory) TopoEventHandler()
TopoEventHandler handle topo device events
type Synchronizer ¶
type Synchronizer struct { context.Context *topodevice.Device // contains filtered or unexported fields }
Synchronizer enables proper configuring of a device based on store events and cache of operational data
func New ¶
func New(context context.Context, device *topodevice.Device, opStateChan chan<- events.OperationalStateEvent, errChan chan<- events.DeviceResponse, opStateCache devicechange.TypedValueMap, mReadOnlyPaths modelregistry.ReadOnlyPathMap, target southbound.TargetIf, getStateMode modelregistry.GetStateMode, opStateCacheLock *syncPrimitives.RWMutex, deviceChangeStore device.Store) (*Synchronizer, error)
New builds a new Synchronizer given the parameters, starts the connection with the device and polls the capabilities