gnmiserver

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package gnmiserver provides a base implementation of a gNMI server based on configtree

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GNMIServer

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

GNMIServer provids gNMI access to a backing GNMIConfigurable

func NewGNMIServer

func NewGNMIServer(configurable *configtree.GNMIConfigurable, logPrefix string) *GNMIServer

NewGNMIServer creates a new gNMI server backed by the specified gNMI configurable entity

func (*GNMIServer) Capabilities

func (s *GNMIServer) Capabilities(ctx context.Context, request *gnmi.CapabilityRequest) (*gnmi.CapabilityResponse, error)

Capabilities allows the client to retrieve the set of capabilities that is supported by the target. This allows the target to validate the service version that is implemented and retrieve the set of models that the target supports. The models can then be specified in subsequent RPCs to restrict the set of data that is utilized. Reference: gNMI Specification Section 3.2

func (*GNMIServer) Get

func (s *GNMIServer) Get(ctx context.Context, request *gnmi.GetRequest) (*gnmi.GetResponse, error)

Get retrieves a snapshot of data from the target. A Get RPC requests that the target snapshots a subset of the data tree as specified by the paths included in the message and serializes this to be returned to the client using the specified encoding. Reference: gNMI Specification Section 3.3

func (*GNMIServer) Set

func (s *GNMIServer) Set(ctx context.Context, request *gnmi.SetRequest) (*gnmi.SetResponse, error)

Set allows the client to modify the state of data on the target. The paths to modified along with the new values that the client wishes to set the value to. Reference: gNMI Specification Section 3.4

func (*GNMIServer) Subscribe

func (s *GNMIServer) Subscribe(server gnmi.GNMI_SubscribeServer) error

Subscribe allows a client to request the target to send it values of particular paths within the data tree. These values may be streamed at a particular cadence (STREAM), sent one off on a long-lived channel (POLL), or sent as a one-off retrieval (ONCE). Reference: gNMI Specification Section 3.5

Jump to

Keyboard shortcuts

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