Documentation ¶
Index ¶
- type CallbackHandler
- type ConfigChangeCallback
- type ConfigSetupCallback
- type RebootCallback
- type RotateCertificatesCallback
- type Service
- func (s *Service) CanGenerateCSR(ctx context.Context, req *pbc.CanGenerateCSRRequest) (*pbc.CanGenerateCSRResponse, error)
- func (s *Service) CancelReboot(ctx context.Context, req *pbs.CancelRebootRequest) (*pbs.CancelRebootResponse, error)
- func (s *Service) Capabilities(ctx context.Context, req *pbg.CapabilityRequest) (*pbg.CapabilityResponse, error)
- func (s *Service) Get(ctx context.Context, req *pbg.GetRequest) (*pbg.GetResponse, error)
- func (s *Service) GetCertificates(ctx context.Context, req *pbc.GetCertificatesRequest) (*pbc.GetCertificatesResponse, error)
- func (s *Service) GetTLSConfigForClientCallback(*tls.ClientHelloInfo) (*tls.Config, error)
- func (s *Service) Install(stream pbc.CertificateManagement_InstallServer) error
- func (s *Service) LockService()
- func (s *Service) OverwriteConfig(jsonConfig []byte)
- func (s *Service) Ping(req *pbs.PingRequest, stream pbs.System_PingServer) error
- func (s *Service) Reboot(ctx context.Context, req *pbs.RebootRequest) (*pbs.RebootResponse, error)
- func (s *Service) RebootStatus(ctx context.Context, req *pbs.RebootStatusRequest) (*pbs.RebootStatusResponse, error)
- func (s *Service) RevokeCertificates(ctx context.Context, req *pbc.RevokeCertificatesRequest) (*pbc.RevokeCertificatesResponse, error)
- func (s *Service) Rotate(stream pbc.CertificateManagement_RotateServer) error
- func (s *Service) Set(ctx context.Context, req *pbg.SetRequest) (*pbg.SetResponse, error)
- func (s *Service) SetPackage(stream pbs.System_SetPackageServer) error
- func (s *Service) StartService()
- func (s *Service) StopService()
- func (s *Service) Subscribe(stream pbg.GNMI_SubscribeServer) error
- func (s *Service) SwitchControlProcessor(ctx context.Context, req *pbs.SwitchControlProcessorRequest) (*pbs.SwitchControlProcessorResponse, error)
- func (s *Service) Time(ctx context.Context, req *pbs.TimeRequest) (*pbs.TimeResponse, error)
- func (s *Service) Traceroute(req *pbs.TracerouteRequest, stream pbs.System_TracerouteServer) error
- func (s *Service) UnlockService()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackHandler ¶
type CallbackHandler struct { CallbackSetup ConfigSetupCallback CallbackChange ConfigChangeCallback CallbackReboot RebootCallback CallbackRotateCerts RotateCertificatesCallback }
type ConfigChangeCallback ¶
type ConfigChangeCallback func(ygot.ValidatedGoStruct) error
ConfigChangeCallback is the signature of the function to apply a validated config to the physical device.
type ConfigSetupCallback ¶
type ConfigSetupCallback func(ygot.ValidatedGoStruct) error
type RebootCallback ¶
type RebootCallback func() error
type Service ¶
type Service struct { ConfigUpdate chan bool // contains filtered or unexported fields }
Service struct maintains the data structure for device config and implements the gnxi interface. It supports Capabilities, Get, Set and Subscribe APIs.
func NewService ¶
func NewService(auth *shared.Authenticator, model *gnmi.Model, certManager *cert.Manager, config []byte, callbackSetup ConfigSetupCallback, callbackChange ConfigChangeCallback, callbackReboot RebootCallback, callbackRotateCerts RotateCertificatesCallback) (*Service, error)
NewService creates an instance of Service with given json config.
func (*Service) CanGenerateCSR ¶
func (s *Service) CanGenerateCSR(ctx context.Context, req *pbc.CanGenerateCSRRequest) (*pbc.CanGenerateCSRResponse, error)
func (*Service) CancelReboot ¶
func (s *Service) CancelReboot(ctx context.Context, req *pbs.CancelRebootRequest) (*pbs.CancelRebootResponse, error)
func (*Service) Capabilities ¶
func (s *Service) Capabilities(ctx context.Context, req *pbg.CapabilityRequest) (*pbg.CapabilityResponse, error)
Capabilities returns supported encodings and supported models.
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, req *pbg.GetRequest) (*pbg.GetResponse, error)
Get implements the Get RPC in gNMI spec and provides user auth.
func (*Service) GetCertificates ¶
func (s *Service) GetCertificates(ctx context.Context, req *pbc.GetCertificatesRequest) (*pbc.GetCertificatesResponse, error)
func (*Service) GetTLSConfigForClientCallback ¶
func (*Service) Install ¶
func (s *Service) Install(stream pbc.CertificateManagement_InstallServer) error
func (*Service) LockService ¶
func (s *Service) LockService()
func (*Service) OverwriteConfig ¶
Overwrites the internal gNMI config.
func (*Service) Ping ¶
func (s *Service) Ping(req *pbs.PingRequest, stream pbs.System_PingServer) error
func (*Service) Reboot ¶
func (s *Service) Reboot(ctx context.Context, req *pbs.RebootRequest) (*pbs.RebootResponse, error)
func (*Service) RebootStatus ¶
func (s *Service) RebootStatus(ctx context.Context, req *pbs.RebootStatusRequest) (*pbs.RebootStatusResponse, error)
func (*Service) RevokeCertificates ¶
func (s *Service) RevokeCertificates(ctx context.Context, req *pbc.RevokeCertificatesRequest) (*pbc.RevokeCertificatesResponse, error)
func (*Service) Rotate ¶
func (s *Service) Rotate(stream pbc.CertificateManagement_RotateServer) error
func (*Service) Set ¶
func (s *Service) Set(ctx context.Context, req *pbg.SetRequest) (*pbg.SetResponse, error)
Set implements the Set RPC in gNMI spec and provides user auth.
func (*Service) SetPackage ¶
func (s *Service) SetPackage(stream pbs.System_SetPackageServer) error
func (*Service) StartService ¶
func (s *Service) StartService()
func (*Service) StopService ¶
func (s *Service) StopService()
func (*Service) SwitchControlProcessor ¶
func (s *Service) SwitchControlProcessor(ctx context.Context, req *pbs.SwitchControlProcessorRequest) (*pbs.SwitchControlProcessorResponse, error)
func (*Service) Time ¶
func (s *Service) Time(ctx context.Context, req *pbs.TimeRequest) (*pbs.TimeResponse, error)
func (*Service) Traceroute ¶
func (s *Service) Traceroute(req *pbs.TracerouteRequest, stream pbs.System_TracerouteServer) error
func (*Service) UnlockService ¶
func (s *Service) UnlockService()
Click to show internal directories.
Click to hide internal directories.