Documentation ¶
Index ¶
- func NewDeviceDriver(config *rest.Config, opts ...Option) (*deviceDriver, error)
- type Cache
- type CacheOption
- type Deviation
- type GrpcServer
- type 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
- type Option
- type Options
- type 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
- type ResourceData
- type ServerOption
- type Target
- type TargetOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct { netwdevpb.UnimplementedCacheStatusServer netwdevpb.UnimplementedCacheUpdateServer Mutex sync.RWMutex NewK8sOperatorUpdates bool Data map[int]map[string]*ResourceData Levels []int NewOnChangeUpdates bool OnChangeReApplyCache bool OnChangeDeletes []string OnChangeUpdates []string OnChangeDeviations map[string]*Deviation CurrentConfig []byte // contains filtered or unexported fields }
func NewCache ¶
func NewCache(opts ...CacheOption) *Cache
func (*Cache) Request ¶
func (c *Cache) Request(ctx context.Context, req *netwdevpb.CacheStatusRequest) (*netwdevpb.CacheStatusReply, error)
Request is a GRPC service that provides the cache status
func (*Cache) Update ¶
func (c *Cache) Update(ctx context.Context, req *netwdevpb.CacheUpdateRequest) (*netwdevpb.CacheUpdateReply, error)
Update is a GRPC service that updates the cache with new information
type CacheOption ¶
type CacheOption func(*Cache)
CacheOption can be used to manipulate Options.
func WithCacheLogger ¶
func WithCacheLogger(log logging.Logger) CacheOption
WithCacheLogger specifies how the Reconciler should log messages.
type Deviation ¶
type Deviation struct { OnChangeAction netwdevpb.Deviation_OnChangeAction Pel []*gnmi.PathElem Value []byte DeviationAction netwdevpb.Deviation_DeviationAction Change bool }
type GrpcServer ¶
type GrpcServer struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer(opts ...ServerOption) *GrpcServer
func (*GrpcServer) GetAddress ¶
func (s *GrpcServer) GetAddress() string
type K8sApi ¶
type K8sApi struct { client.Client NameSpaceResource string // this is the namespace the network node resource got deployed in, used for secrets, etc NameSpacePoD string // this is the namespace on which the pod runs, which is used to get/update configmap DeviceName string // contains filtered or unexported fields }
K8sApi is a struct to hold the information to talk to the K8s api server
func NewK8sApi ¶
func NewK8sApi(opts ...K8sApiOption) *K8sApi
func (*K8sApi) GetCredentials ¶
GetCredentials gets the username and apssword from the secret
func (*K8sApi) GetNetworkNode ¶
func (*K8sApi) SetNetworkNodeStatus ¶
func (a *K8sApi) SetNetworkNodeStatus(ctx context.Context, dDetails *ndrv1.DeviceDetails, c nddv1.Condition) error
SetNetworkNodeStatus updates the network device in not configured condition
type K8sApiOption ¶
type K8sApiOption func(*K8sApi)
K8sApiOption can be used to manipulate Options.
func WithK8sApiClient ¶
func WithK8sApiClient(c client.Client) K8sApiOption
WithK8sApiClient initializes the client
func WithK8sApiDeviceName ¶
func WithK8sApiDeviceName(s string) K8sApiOption
WithClient initializes the client
func WithK8sApiLogger ¶
func WithK8sApiLogger(log logging.Logger) K8sApiOption
WithTargetLogger specifies how the object should log messages.
func WithK8sApiNameSpace ¶
func WithK8sApiNameSpace(s string) K8sApiOption
WithClient initializes the client
type Option ¶
type Option func(*Options)
Option can be used to manipulate Options.
func WithAutoPilot ¶
WithAutoPilot initializes the device mode of operation
func WithDeviceName ¶
WithDeviceName initializes the device name in the device driver
func WithGrpcServer ¶
WithGrpcServer initializes the grpc server in the device driver
func WithLogger ¶
WithLogger specifies how the Reconciler should log messages.
func WithNameSpace ¶
WithNameSpace initializes the namespace the device driver uses
func WithScheme ¶
WithDeviceName initializes the device name in the device driver
type Register ¶
type Register struct { register.UnimplementedRegistrationServer RegisteredDevices map[nddv1.DeviceType]*register.RegistrationInfo // contains filtered or unexported fields }
func NewRegister ¶
func NewRegister(opts ...RegisterOption) *Register
func (*Register) Create ¶
func (r *Register) Create(ctx context.Context, req *register.RegistrationInfo) (*register.DeviceType, error)
func (*Register) Delete ¶
func (r *Register) Delete(ctx context.Context, req *register.DeviceType) (*register.DeviceType, error)
DeRegister is a GRPC service that deregisters the device type
func (*Register) GetDeviceMatches ¶
func (r *Register) GetDeviceMatches() map[string]nddv1.DeviceType
GetDeviceMatches returns a map indexed by matchstring with element devicetype
func (*Register) GetDeviceTypes ¶
func (r *Register) GetDeviceTypes() []nddv1.DeviceType
GetDeviceTypes returns all devicetypes that are registered
func (*Register) GetExceptionPaths ¶
func (r *Register) GetExceptionPaths(d nddv1.DeviceType) []string
func (*Register) GetExplicitExceptionPaths ¶
func (r *Register) GetExplicitExceptionPaths(d nddv1.DeviceType) []string
func (*Register) GetSubscriptions ¶
func (r *Register) GetSubscriptions(d nddv1.DeviceType) []string
func (*Register) Read ¶
func (r *Register) Read(ctx context.Context, req *register.DeviceType) (*register.RegistrationInfo, error)
func (*Register) Update ¶
func (r *Register) Update(ctx context.Context, req *register.RegistrationInfo) (*register.DeviceType, error)
type RegisterOption ¶
type RegisterOption func(*Register)
RegisterOption can be used to manipulate Options.
func WithRegisterLogger ¶
func WithRegisterLogger(log logging.Logger) RegisterOption
WithRegisterLogger specifies how the Reconciler should log messages.
type ResourceData ¶
type ResourceData struct { Config *netwdevpb.CacheUpdateRequest CacheStatus netwdevpb.CacheStatusReply_CacheResourceStatus // Status of the resource }
type ServerOption ¶
type ServerOption func(*GrpcServer)
Option can be used to manipulate Options.
func WithGrpcServerAddress ¶
func WithGrpcServerAddress(a string) ServerOption
func WithServerLogger ¶
func WithServerLogger(log logging.Logger) ServerOption
WithLogger specifies how the Reconciler should log messages.
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
target is a struct to hold the target configuration used to handle gnmi capabilities
func (*Target) DeviceCapabilities ¶
type TargetOption ¶
type TargetOption func(*Target)
TargetOption can be used to manipulate Options.
func WithTargetConfig ¶
func WithTargetConfig(tc *collector.TargetConfig) TargetOption
func WithTargetLogger ¶
func WithTargetLogger(log logging.Logger) TargetOption
WithTargetLogger specifies how the object should log messages.