gnmi

package
v0.0.0-...-1768917 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boolval

func Boolval(b bool) *gnmi.TypedValue

Boolval returns a gnmi.TypedValue from a bool.

func IntfConfigPath

func IntfConfigPath(intfName, leafName string) *gnmi.Path

IntfConfigPath returns an interface config path.

func IntfEthernetStatePath

func IntfEthernetStatePath(intfName, leafName string) *gnmi.Path

IntfEthernetStatePath returns an interface ethernet state path.

func IntfPath

func IntfPath(intfName, leafName string) *gnmi.Path

IntfPath returns an interface path.

func IntfStateCountersPath

func IntfStateCountersPath(intfName, leafName string) *gnmi.Path

IntfStateCountersPath returns an interface state counters path.

func IntfStatePath

func IntfStatePath(intfName, leafName string) *gnmi.Path

IntfStatePath returns an interface state path.

func IntfSubIntfIPPath

func IntfSubIntfIPPath(intfName, leafName, ipVersion, ipAddr string) *gnmi.Path

IntfSubIntfIPPath returns an interface sub interface ip-address path.

func Intval

func Intval(i int64) *gnmi.TypedValue

Intval returns a gnmi.TypedValue from an int64.

func ListWithKey

func ListWithKey(listName, keyName, key string) string

ListWithKey formats a gNMI keyed list and key as a string.

func LldpIntfConfigPath

func LldpIntfConfigPath(intfName, leafName string) *gnmi.Path

LldpIntfConfigPath returns an LLDP interface config path.

func LldpIntfCountersPath

func LldpIntfCountersPath(intfName, leafName string) *gnmi.Path

LldpIntfCountersPath returns an LLDP interface counters path.

func LldpIntfPath

func LldpIntfPath(intfName, leafName string) *gnmi.Path

LldpIntfPath returns an LLDP interface path.

func LldpIntfStatePath

func LldpIntfStatePath(intfName, leafName string) *gnmi.Path

LldpIntfStatePath returns an LLDP interface state path.

func LldpNeighborStatePath

func LldpNeighborStatePath(intfName, id, leafName string) *gnmi.Path

LldpNeighborStatePath returns an LLDP neighbor state path.

func LldpStatePath

func LldpStatePath(leafName string) *gnmi.Path

LldpStatePath returns an LLDP state path.

func MultiKeyList

func MultiKeyList(listName string, keysAndVals ...string) string

MultiKeyList formats a gNMI list with multiple key-value pairs as a string

func NewGNMIProvider

func NewGNMIProvider(client gnmi.GNMIClient, cfg *agnmi.Config,
	paths []string, monitor provider.Monitor) provider.GNMIProvider

NewGNMIProvider returns a read-only gNMI provider.

func NewSimpleGNMIClient

func NewSimpleGNMIClient(processor setRequestProcessor) gnmi.GNMIClient

NewSimpleGNMIClient returns a simpleGNMIClient.

func Path

func Path(element ...string) *gnmi.Path

Path returns a gnmi.Path given a set of elements.

func PathAppend

func PathAppend(path *gnmi.Path, element ...string) *gnmi.Path

PathAppend parses the specified elements into gnmi.PathElems and appends them to the provided gnmi.Path, returning a new copy.

func PathCopy

func PathCopy(oldPath *gnmi.Path) *gnmi.Path

PathCopy creates a new copy of a gNMI PathElem slice.

func PathFromString

func PathFromString(path string) *gnmi.Path

PathFromString returns a gnmi.Path from a valid string representation.

func PathJoin

func PathJoin(p1, p2 *gnmi.Path) *gnmi.Path

PathJoin combines two gNMI paths into one.

func PathMatch

func PathMatch(path, pattern *gnmi.Path) bool

PathMatch returns true if the path `path` matches the provided path pattern `pattern`.

func PlatformComponentConfigPath

func PlatformComponentConfigPath(name, leafName string) *gnmi.Path

PlatformComponentConfigPath returns a component config path.

func PlatformComponentPath

func PlatformComponentPath(name, leafName string) *gnmi.Path

PlatformComponentPath returns a component path.

func PlatformComponentStatePath

func PlatformComponentStatePath(name, leafName string) *gnmi.Path

PlatformComponentStatePath returns a component state path.

func PollForever

func PollForever(ctx context.Context, client gnmi.GNMIClient,
	interval time.Duration, poller PollFn, errc chan error)

PollForever takes a polling function that performs a complete update of some part of the OpenConfig tree and calls it at the specified interval.

func PollOnce

func PollOnce(ctx context.Context, client gnmi.GNMIClient,
	poller PollFn, errc chan error)

PollOnce takes a polling function that performs a complete update of a some part of the OpenConfig tree and calls it once, putting any errors in the provided error channel.

func Strval

func Strval(s string) *gnmi.TypedValue

Strval returns a gnmi.TypedValue from a string.

func Uintval

func Uintval(u uint64) *gnmi.TypedValue

Uintval returns a gnmi.TypedValue from a uint64.

func Unmarshal

func Unmarshal(val *gnmi.TypedValue) interface{}

Unmarshal will return an interface representing the supplied value.

func Update

func Update(path *gnmi.Path, val *gnmi.TypedValue) *gnmi.Update

Update creates a gNMI.Update.

Types

type Gnmi

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

A Gnmi connects to a gNMI server at a target device and emits updates as gNMI SetRequests.

func (*Gnmi) InitGNMI

func (p *Gnmi) InitGNMI(client gnmi.GNMIClient)

InitGNMI initializes the provider with a gNMI client.

func (*Gnmi) OpenConfig

func (p *Gnmi) OpenConfig() bool

OpenConfig indicates whether the provider wants OpenConfig type-checking.

func (*Gnmi) Origin

func (p *Gnmi) Origin() string

Origin indicates that the provider streams to an OpenConfig model.

func (*Gnmi) Run

func (p *Gnmi) Run(ctx context.Context) error

Run kicks off the provider.

type PollFn

type PollFn func() ([]*gnmi.SetRequest, error)

A PollFn polls a target device and returns a slice of gNMI SetRequests.

Jump to

Keyboard shortcuts

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