dialout_server

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: 14 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(srv *Server, stream spb.GNMIDialOut_PublishServer) (err error)

Run process streaming from publish 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 GNMIDialOut_PublishServer implementation. Each client that connects via PublistRequest sends subscribeResponse to the server.

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

func (srv *Server) Port() int64

Port returns the port the Server is listening to.

func (*Server) Publish

func (srv *Server) Publish(stream spb.GNMIDialOut_PublishServer) error

Publish implements the GNMI DialOut Publish RPC.

func (*Server) Serve

func (srv *Server) Serve() error

Serve will start the Server serving and block until closed.

func (*Server) SetDataStore

func (srv *Server) SetDataStore(dataStore interface{})

Port returns the port the Server is listening to.

func (*Server) Stop

func (srv *Server) Stop() error

Jump to

Keyboard shortcuts

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