Versions in this module Expand all Collapse all v0 v0.2.1 Jul 30, 2021 Changes in this version + type APIEstablisher struct + func NewAPIEstablisher(client resource.ClientApplicator, log logging.Logger, ...) *APIEstablisher + func (e *APIEstablisher) UpdateConfigMap(ctx context.Context, cfg *string) error + func (e *APIEstablisher) UpdateDeviceStatusNotReady(ctx context.Context, dDetails *ndddvrv1.DeviceDetails) error + func (e *APIEstablisher) UpdateDeviceStatusReady(ctx context.Context, dDetails *ndddvrv1.DeviceDetails) error + type Cache struct + CurrentConfig []byte + Data map[int]map[string]*ResourceData + Levels []int + Mutex sync.RWMutex + NewK8sOperatorUpdates bool + NewOnChangeUpdates bool + OnChangeDeletes []string + OnChangeDeviations map[string]*Deviation + OnChangeReApplyCache bool + OnChangeUpdates []string + func NewCache(log logging.Logger) *Cache + func (c *Cache) CheckCache(dep string) (int, string, bool) + func (c *Cache) CheckMissingDependency(dependencies []string) bool + func (c *Cache) GetCurrentConfig() []byte + func (c *Cache) GetNewK8sOperatorUpdates() bool + func (c *Cache) GetNewOnChangeUpdates() bool + func (c *Cache) GetOnChangeDeletes() []string + func (c *Cache) GetOnChangeDeviations() map[string]*Deviation + func (c *Cache) GetOnChangeReApplyCache() bool + func (c *Cache) GetOnChangeUpdates() []string + func (c *Cache) GetParentDependencyDeleteStatus(dependencies []string) bool + func (c *Cache) LocatePathInCache(pel []*gnmi.PathElem) (interface{}, bool, error) + func (c *Cache) Lock() + func (c *Cache) Request(ctx context.Context, req *netwdevpb.CacheStatusRequest) (*netwdevpb.CacheStatusReply, error) + func (c *Cache) SetCurrentConfig(b []byte) + func (c *Cache) SetNewK8sOperatorUpdates(b bool) + func (c *Cache) SetNewOnChangeUpdates(b bool) + func (c *Cache) SetOnChangeCacheUpdates(autoPilot bool, onChangeDeviations map[string]*Deviation) + func (c *Cache) SetOnChangeReApplyCache(b bool) + func (c *Cache) SetStatus(l int, o string, s netwdevpb.CacheStatusReply_CacheResourceStatus) error + func (c *Cache) ShowCacheStatus() + func (c *Cache) Unlock() + func (c *Cache) Update(ctx context.Context, req *netwdevpb.CacheUpdateRequest) (*netwdevpb.CacheUpdateReply, error) + func (c *Cache) UpdateLeafRefDependency(leafRefDep string) + 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 Deviation struct + Change bool + DeviationAction netwdevpb.Deviation_DeviationAction + OnChangeAction netwdevpb.Deviation_OnChangeAction + Pel []*gnmi.PathElem + Value []byte + type DeviceCollector struct + Mutex sync.RWMutex + RetryTimer time.Duration + Subscriptions map[string]*Subscription + Target *collector.Target + TargetReceiveBuffer uint + func NewDeviceCollector(t *collector.Target, log logging.Logger) *DeviceCollector + func (c *DeviceCollector) GetSubscription(subName string) bool + func (c *DeviceCollector) Lock() + func (c *DeviceCollector) StartSubscription(dctx context.Context, subName string, sub []string) error + func (c *DeviceCollector) StopSubscription(ctx context.Context, sub string) error + func (c *DeviceCollector) Unlock() + type DeviceDiscoverer struct + func NewDeviceDiscoverer(target *collector.Target, log logging.Logger) *DeviceDiscoverer + func (d *DeviceDiscoverer) Discover(ctx context.Context) (nddv1.DeviceType, error) + type DeviceDriver struct + AutoPilot *bool + Cache *Cache + Collector Collector + Ctx context.Context + Debug *bool + Device devices.Device + DeviceDetails *ndddvrv1.DeviceDetails + DeviceName *string + Discoverer Discoverer + GrpcServer *grpc.Server + GrpcServerAddress *string + GrpcServerPort *int + InitialConfig map[string]interface{} + K8sClient *client.Client + NetworkNodeKind *string + Objects Establisher + Registrator *Registrator + StopCh chan struct{} + SubCh chan bool + Target *collector.Target + TargetConfig *collector.TargetConfig + func NewDeviceDriver(opts ...Option) (*DeviceDriver, error) + func (d *DeviceDriver) DeletedUnwantedConfiguration(f map[string]interface{}, prefix string) + func (d *DeviceDriver) InitDeviceDriverControllers() error + func (d *DeviceDriver) InitGrpcServer() error + func (d *DeviceDriver) InitSubscriptionExceptionPaths() error + func (d *DeviceDriver) Start() error + func (d *DeviceDriver) StartGnmiSubscriptionHandler() + func (d *DeviceDriver) StartGrpcServer(s string) error + func (d *DeviceDriver) StartReconcileProcess() error + func (d *DeviceDriver) StopGrpcServer() + func (d *DeviceDriver) UpdateLatestConfigWithGnmi() error + type Discoverer interface + Discover func(ctx context.Context) (nddv1.DeviceType, error) + type ElementKeyValue struct + Element string + KeyName string + KeyValue interface{} + type Establisher interface + UpdateConfigMap func(ctx context.Context, cfg *string) error + UpdateDeviceStatusNotReady func(ctx context.Context, dd *ndddvrv1.DeviceDetails) error + UpdateDeviceStatusReady func(ctx context.Context, dd *ndddvrv1.DeviceDetails) error + type Option func(d *DeviceDriver) + func WithAutoPilot(b *bool) Option + func WithContext() Option + func WithDebug(b *bool) Option + func WithDeviceName(n *string) Option + func WithEstablisher(er *APIEstablisher) Option + func WithGrpcServer(s *string) Option + func WithGzip(b *bool) Option + func WithInsecure(b *bool) Option + func WithK8sClient(c *client.Client) Option + func WithLogger(log logging.Logger) Option + func WithPassword(p *string) Option + func WithSkipVerify(b *bool) Option + func WithTLSCA(t *string) Option + func WithTLSCert(t *string) Option + func WithTLSKey(t *string) Option + func WithTargetAddress(t *string) Option + func WithTargetName(n *string) Option + func WithTimeout(t time.Duration) Option + func WithUsername(u *string) Option + type Registrator struct + DeviceKind string + DeviceMatch string + ExceptionPaths []string + ExplicitExceptionPaths []string + Subscriptions []string + func NewRegistrator(log logging.Logger, subCh chan bool) *Registrator + func (r *Registrator) GetDeviceKind() string + func (r *Registrator) GetDeviceMatch() string + func (r *Registrator) GetExceptionPaths() []string + func (r *Registrator) GetExplicitExceptionPaths() []string + func (r *Registrator) GetSubscriptions() []string + func (r *Registrator) Register(ctx context.Context, req *netwdevpb.RegistrationRequest) (*netwdevpb.RegistrationReply, error) + type ResourceData struct + CacheStatus netwdevpb.CacheStatusReply_CacheResourceStatus + Config *netwdevpb.CacheUpdateRequest + type Subscription struct + CancelFn context.CancelFunc + StopCh chan bool