gnmiclient

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	IPAddress             string
	Port                  string
	User                  string
	Password              string
	TLS                   bool
	TLSCert               string
	TLSKey                string
	TLSCa                 string
	TLSInsecureSkipVerify bool
	ForceEncoding         string
	DevName               string
	ScrapeInterval        time.Duration
	MaxLife               time.Duration
	GnmiSubscriptionMode  gnmi.SubscriptionMode
	GnmiUpdatesOnly       bool
	OverSampling          int64
}

type GnmiClient

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

GnmiClient The gNMI client object

func New

func New(cfg Config) (*GnmiClient, error)

New Creates a new GnmiClient instance

func (*GnmiClient) Close

func (c *GnmiClient) Close()

Close closes the GnmiClient instance. If the shutdown function is not nil, it is called to gracefully terminate the underlying client.

func (*GnmiClient) GetMetrics

func (m *GnmiClient) GetMetrics(ch chan<- exporter.GMetric)

GetMetrics implements the exporter GMetricSource interface It is called by the exporter, and it sends the current reading of counters and gauges

func (*GnmiClient) RegisterPlugin

func (c *GnmiClient) RegisterPlugin(name string, plug plugin) error

RegisterPlugin registers a plugin instance into the GnmiClient.

func (*GnmiClient) Start

func (c *GnmiClient) Start() error

Start starts the goRoutine that take care of GNMI communication with the device It is non-blocking

Jump to

Keyboard shortcuts

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