Documentation ¶
Index ¶
- func Boolval(b bool) *gnmi.TypedValue
- func IntfConfigPath(intfName, leafName string) *gnmi.Path
- func IntfEthernetStatePath(intfName, leafName string) *gnmi.Path
- func IntfPath(intfName, leafName string) *gnmi.Path
- func IntfStateCountersPath(intfName, leafName string) *gnmi.Path
- func IntfStatePath(intfName, leafName string) *gnmi.Path
- func IntfSubIntfIPPath(intfName, leafName, ipVersion, ipAddr string) *gnmi.Path
- func Intval(i int64) *gnmi.TypedValue
- func ListWithKey(listName, keyName, key string) string
- func LldpIntfConfigPath(intfName, leafName string) *gnmi.Path
- func LldpIntfCountersPath(intfName, leafName string) *gnmi.Path
- func LldpIntfPath(intfName, leafName string) *gnmi.Path
- func LldpIntfStatePath(intfName, leafName string) *gnmi.Path
- func LldpNeighborStatePath(intfName, id, leafName string) *gnmi.Path
- func LldpStatePath(leafName string) *gnmi.Path
- func MultiKeyList(listName string, keysAndVals ...string) string
- func NewGNMIProvider(client gnmi.GNMIClient, cfg *agnmi.Config, paths []string, ...) provider.GNMIProvider
- func NewSimpleGNMIClient(processor setRequestProcessor) gnmi.GNMIClient
- func Path(element ...string) *gnmi.Path
- func PathAppend(path *gnmi.Path, element ...string) *gnmi.Path
- func PathCopy(oldPath *gnmi.Path) *gnmi.Path
- func PathFromString(path string) *gnmi.Path
- func PathJoin(p1, p2 *gnmi.Path) *gnmi.Path
- func PathMatch(path, pattern *gnmi.Path) bool
- func PlatformComponentConfigPath(name, leafName string) *gnmi.Path
- func PlatformComponentPath(name, leafName string) *gnmi.Path
- func PlatformComponentStatePath(name, leafName string) *gnmi.Path
- func PollForever(ctx context.Context, client gnmi.GNMIClient, interval time.Duration, ...)
- func PollOnce(ctx context.Context, client gnmi.GNMIClient, poller PollFn, errc chan error)
- func Strval(s string) *gnmi.TypedValue
- func Uintval(u uint64) *gnmi.TypedValue
- func Unmarshal(val *gnmi.TypedValue) interface{}
- func Update(path *gnmi.Path, val *gnmi.TypedValue) *gnmi.Update
- type Gnmi
- type PollFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntfConfigPath ¶
IntfConfigPath returns an interface config path.
func IntfEthernetStatePath ¶
IntfEthernetStatePath returns an interface ethernet state path.
func IntfStateCountersPath ¶
IntfStateCountersPath returns an interface state counters path.
func IntfStatePath ¶
IntfStatePath returns an interface state path.
func IntfSubIntfIPPath ¶
IntfSubIntfIPPath returns an interface sub interface ip-address path.
func ListWithKey ¶
ListWithKey formats a gNMI keyed list and key as a string.
func LldpIntfConfigPath ¶
LldpIntfConfigPath returns an LLDP interface config path.
func LldpIntfCountersPath ¶
LldpIntfCountersPath returns an LLDP interface counters path.
func LldpIntfPath ¶
LldpIntfPath returns an LLDP interface path.
func LldpIntfStatePath ¶
LldpIntfStatePath returns an LLDP interface state path.
func LldpNeighborStatePath ¶
LldpNeighborStatePath returns an LLDP neighbor state path.
func LldpStatePath ¶
LldpStatePath returns an LLDP state path.
func MultiKeyList ¶
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 PathAppend ¶
PathAppend parses the specified elements into gnmi.PathElems and appends them to the provided gnmi.Path, returning a new copy.
func PathFromString ¶
PathFromString returns a gnmi.Path from a valid string representation.
func PathMatch ¶
PathMatch returns true if the path `path` matches the provided path pattern `pattern`.
func PlatformComponentConfigPath ¶
PlatformComponentConfigPath returns a component config path.
func PlatformComponentPath ¶
PlatformComponentPath returns a component path.
func PlatformComponentStatePath ¶
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 ¶
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.
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 ¶
OpenConfig indicates whether the provider wants OpenConfig type-checking.
type PollFn ¶
type PollFn func() ([]*gnmi.SetRequest, error)
A PollFn polls a target device and returns a slice of gNMI SetRequests.