Versions in this module Expand all Collapse all v0 v0.1.2 Sep 7, 2021 Changes in this version + func CreateSubscriptionRequest(target, subName string, paths []*gnmi.Path) (*gnmi.SubscribeRequest, error) + type Collector interface + GetSubscription func(subName string) bool + Lock func() + StartSubscription func(ctx context.Context, subName string, sub []string) error + StopSubscription func(ctx context.Context, sub string) error + Unlock func() + type DeviationServer struct + Targets map[string]*Target + func NewDeviationServer(opts ...Option) *DeviationServer + func (d *DeviationServer) HandleTargetUpdate(ctx context.Context, tu TargetUpdate) error + func (d *DeviationServer) StartTargetChangeHandler() + type DeviceCollectorOption func(*GNMICollector) + func WithDeviceCollectorLogger(log logging.Logger) DeviceCollectorOption + type GNMICollector struct + Mutex sync.RWMutex + RetryTimer time.Duration + Subscriptions map[string]*Subscription + Target *target.Target + TargetReceiveBuffer uint + func NewGNMICollector(t *target.Target, opts ...DeviceCollectorOption) *GNMICollector + func (c *GNMICollector) GetSubscription(subName string) bool + func (c *GNMICollector) Lock() + func (c *GNMICollector) StartSubscription(dctx context.Context, target, subName string, paths []*gnmi.Path) error + func (c *GNMICollector) StopSubscription(ctx context.Context, sub string) error + func (c *GNMICollector) Unlock() + type Option func(d *DeviationServer) + func WithEventChannels(e map[string]chan event.GenericEvent) Option + func WithLogging(l logging.Logger) Option + func WithStopChannel(stopCh chan struct{}) Option + func WithTargetUpdateChannel(tu chan TargetUpdate) Option + type Subscription struct + CancelFn context.CancelFunc + StopCh chan bool + type Target struct + Collector *GNMICollector + Config *types.TargetConfig + StopCh chan struct{} + Target *target.Target + func (t *Target) ReconcileOnChange(resp *gnmi.SubscribeResponse) error + func (t *Target) StartGnmiSubscriptionHandler(ctx context.Context) + type TargetAction string + const TargetAdd + const TargetDelete + type TargetUpdate struct + Action TargetAction + Name string + TargetConfig *types.TargetConfig