stats

package
v0.0.0-...-cb4d464 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "gnmi"

Type defines the name resolution for this client type.

Variables

This section is empty.

Functions

func ProtoResponse

func ProtoResponse(notifs ...client.Notification) (*gpb.SubscribeResponse, error)

ProtoResponse converts client library Notification types into gNMI SubscribeResponse proto. An error is returned if any notifications have invalid paths or if update values can't be converted to gpb.TypedValue.

Types

type Client

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

Client handles execution of the query and caching of its results.

func NewFromConn

func NewFromConn(ctx context.Context, conn *grpc.ClientConn, d client.Destination) (*Client, error)

NewFromConn creates and returns the client based on the provided transport.

func NewStatsClient

func NewStatsClient(ctx context.Context, d client.Destination) (*Client, error)

New returns a new initialized client. If error is nil, returned Client has established a connection to d. Close needs to be called for cleanup.

func (*Client) Close

func (c *Client) Close() error

Close forcefully closes the underlying connection, terminating the query right away. It's safe to call Close multiple times.

func (*Client) Peer

func (c *Client) Peer() string

Peer returns the peer of the current stream. If the client is not created or if the peer is not valid nil is returned.

func (*Client) Poll

func (c *Client) Poll() error

Poll will send a single gNMI poll request to the server.

func (*Client) Recv

func (c *Client) Recv() error

Recv will recieve a single message from the server and process it based on the provided handlers (Proto or Notification).

func (*Client) RecvAll

func (c *Client) RecvAll() error

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, q client.Query) error

Subscribe sends the gNMI Subscribe RPC to the server.

type Record

type Record struct {
	Rts []time.Time //request time stamp
	Sts []time.Time //sync time stamp
}

Jump to

Keyboard shortcuts

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