gnmi

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModelData = []*pb.ModelData{{
		Name:         "packet-transport",
		Organization: "Nippon Telegraph and Telephone Corporation",
		Version:      "0.7.0",
	}}
)

Functions

This section is empty.

Types

type ConfigCallback

type ConfigCallback func(ygot.ValidatedGoStruct) error

ConfigCallback is the signature of the function to apply a validated config to the physical device.

type GoStructEnumData

type GoStructEnumData map[string]map[int64]ygot.EnumDefinition

GoStructEnumData is the data type to maintain GoStruct enum type.

type JSONUnmarshaler

type JSONUnmarshaler func([]byte, ygot.GoStruct, ...ytypes.UnmarshalOpt) error

JSONUnmarshaler is the signature of the Unmarshal() function in the GoStruct code generated by openconfig ygot library.

type Model

type Model struct {
	// contains filtered or unexported fields
}

Model contains the model data and GoStruct information for the device to config.

func NewModel

NewModel returns an instance of Model struct.

func (*Model) NewConfigStruct

func (m *Model) NewConfigStruct(jsonConfig []byte) (ygot.ValidatedGoStruct, error)

NewConfigStruct creates a ValidatedGoStruct of this model from jsonConfig. If jsonConfig is nil, creates an empty GoStruct.

func (*Model) SupportedModels

func (m *Model) SupportedModels() []string

SupportedModels returns a list of supported models.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server manages a single gNMI Server implementation. Each client that connects via Subscribe or Get will receive a stream of updates based on the requested path. Set request is processed by server too.

func NewServer

func NewServer(model *Model, config []byte, port int64, callback ConfigCallback, opts []grpc.ServerOption) (*Server, error)

NewServer returns an initialized server.

func (*Server) Address

func (srv *Server) Address() string

Address returns the port the Server is listening to.

func (*Server) Capabilities

func (srv *Server) Capabilities(ctx context.Context, req *pb.CapabilityRequest) (*pb.CapabilityResponse, error)

Capabilities returns supported encodings and supported models.

func (*Server) Get

func (srv *Server) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error)

Get implements the Get RPC in gNMI spec.

func (*Server) Port

func (srv *Server) Port() int64

Port returns the port the server is listening to.

func (*Server) Serve

func (srv *Server) Serve() error

Serve will start the Server serving and block until closed.

func (*Server) Set

func (srv *Server) Set(ctx context.Context, req *pb.SetRequest) (*pb.SetResponse, error)

Set implements the Set RPC in gNMI spec.

func (*Server) Subscribe

func (srv *Server) Subscribe(stream pb.GNMI_SubscribeServer) error

Subscribe method is not implemented.

Jump to

Keyboard shortcuts

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