Versions in this module Expand all Collapse all v0 v0.2.1 Jul 30, 2021 Changes in this version + func NewDeviceDriver(config *rest.Config, opts ...Option) (*deviceDriver, 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(opts ...CacheOption) *Cache + func (c *Cache) Lock() + func (c *Cache) Request(ctx context.Context, req *netwdevpb.CacheStatusRequest) (*netwdevpb.CacheStatusReply, error) + func (c *Cache) Unlock() + func (c *Cache) Update(ctx context.Context, req *netwdevpb.CacheUpdateRequest) (*netwdevpb.CacheUpdateReply, error) + type CacheOption func(*Cache) + func WithCacheLogger(log logging.Logger) CacheOption + type Deviation struct + Change bool + DeviationAction netwdevpb.Deviation_DeviationAction + OnChangeAction netwdevpb.Deviation_OnChangeAction + Pel []*gnmi.PathElem + Value []byte + type GrpcServer struct + func NewGrpcServer(opts ...ServerOption) *GrpcServer + func (s *GrpcServer) GetAddress() string + func (s *GrpcServer) Run(ctx context.Context, r *Register, c *Cache) error + func (s *GrpcServer) Start(r *Register, c *Cache) error + type K8sApi struct + DeviceName string + NameSpacePoD string + NameSpaceResource string + func NewK8sApi(opts ...K8sApiOption) *K8sApi + func (a *K8sApi) GetCredentials(ctx context.Context, credName string) (*string, *string, error) + func (a *K8sApi) GetNetworkNode(ctx context.Context) (*ndrv1.NetworkNode, error) + func (a *K8sApi) SetNetworkNodeStatus(ctx context.Context, dDetails *ndrv1.DeviceDetails, c nddv1.Condition) error + func (a *K8sApi) UpdateConfigMap(ctx context.Context, cfg *string) error + type K8sApiOption func(*K8sApi) + func WithK8sApiClient(c client.Client) K8sApiOption + func WithK8sApiDeviceName(s string) K8sApiOption + func WithK8sApiLogger(log logging.Logger) K8sApiOption + func WithK8sApiNameSpace(s string) K8sApiOption + type Option func(*Options) + func WithAutoPilot(b *bool) Option + func WithDebug(b *bool) Option + func WithDeviceName(n *string) Option + func WithGrpcServer(s *string) Option + func WithLogger(log logging.Logger) Option + func WithNameSpace(n *string) Option + func WithScheme(s *runtime.Scheme) Option + type Options struct + AutoPilot bool + CredName string + Debug bool + DeviceName string + GrpcServerAddress string + Namespace string + Scheme *runtime.Scheme + Target *collector.Target + TargetConfig *collector.TargetConfig + type Register struct + RegisteredDevices map[nddv1.DeviceType]*register.RegistrationInfo + func NewRegister(opts ...RegisterOption) *Register + func (r *Register) Create(ctx context.Context, req *register.RegistrationInfo) (*register.DeviceType, error) + func (r *Register) Delete(ctx context.Context, req *register.DeviceType) (*register.DeviceType, error) + func (r *Register) GetDeviceMatches() map[string]nddv1.DeviceType + func (r *Register) GetDeviceTypes() []nddv1.DeviceType + func (r *Register) GetExceptionPaths(d nddv1.DeviceType) []string + func (r *Register) GetExplicitExceptionPaths(d nddv1.DeviceType) []string + func (r *Register) GetSubscriptions(d nddv1.DeviceType) []string + func (r *Register) Read(ctx context.Context, req *register.DeviceType) (*register.RegistrationInfo, error) + func (r *Register) Update(ctx context.Context, req *register.RegistrationInfo) (*register.DeviceType, error) + type RegisterOption func(*Register) + func WithRegisterLogger(log logging.Logger) RegisterOption + type ResourceData struct + CacheStatus netwdevpb.CacheStatusReply_CacheResourceStatus + Config *netwdevpb.CacheUpdateRequest + type ServerOption func(*GrpcServer) + func WithGrpcServerAddress(a string) ServerOption + func WithServerLogger(log logging.Logger) ServerOption + type Target struct + func NewTarget(target *collector.Target, opts ...TargetOption) *Target + func (t *Target) DeviceCapabilities(ctx context.Context) ([]*gnmi.ModelData, error) + func (t *Target) GetTarget() *collector.Target + type TargetOption func(*Target) + func WithTargetConfig(tc *collector.TargetConfig) TargetOption + func WithTargetLogger(log logging.Logger) TargetOption