service

package
v0.0.0-...-ad9c0bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

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 RotateCertificatesCallback

type RotateCertificatesCallback func(certID string) 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 (*Service) CancelReboot

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 (*Service) GetTLSConfigForClientCallback

func (s *Service) GetTLSConfigForClientCallback(*tls.ClientHelloInfo) (*tls.Config, error)

func (*Service) Install

func (*Service) LockService

func (s *Service) LockService()

func (*Service) OverwriteConfig

func (s *Service) OverwriteConfig(jsonConfig []byte)

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 (*Service) RevokeCertificates

func (*Service) Rotate

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) Subscribe

func (s *Service) Subscribe(stream pbg.GNMI_SubscribeServer) 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()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL