gnmi

package
v0.0.0-...-bfb01b6 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client contains information about a subscribe client that has connected to the server.

func NewClient

func NewClient(addr net.Addr) *Client

NewClient returns a new initialized client.

func (*Client) Close

func (c *Client) Close()

Closing of client queue is triggered upon end of stream receive or stream error or fatal error of any client go routine . it will cause cancle of client context and exit of the send goroutines.

func (*Client) Run

func (c *Client) Run(stream gnmipb.GNMI_SubscribeServer) (err error)

Run starts the subscribe client. The first message received must be a SubscriptionList. Once the client is started, it will run until the stream is closed or the schedule completes. For Poll queries the Run will block internally after sync until a Poll request is made to the server.

func (*Client) String

func (c *Client) String() string

String returns the target the client is querying.

type Config

type Config struct {
	// Port for the Server to listen on. If 0 or unset the Server will pick a port
	// for this Server.
	Port int64
}

Config is a collection of values for Server

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(config *Config, opts []grpc.ServerOption) (*Server, error)

New returns an initialized Server.

func (*Server) Address

func (srv *Server) Address() string

Address returns the port the Server is listening to.

func (*Server) Capabilities

Capabilities method is not implemented. Refer to gnxi for examples with openconfig integration

func (*Server) Get

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

Set method is not implemented. Refer to gnxi for examples with openconfig integration

func (*Server) Subscribe

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

Subscribe implements the gNMI Subscribe RPC.

Jump to

Keyboard shortcuts

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