synchronizer

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package synchronizer synchronizes configurations down to devices

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDeviceChangeStore added in v0.6.12

func WithDeviceChangeStore(deviceChangeStore device.Store) func(*Factory)

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

func NewFactory(options ...func(*Factory)) (*Factory, error)

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

Jump to

Keyboard shortcuts

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