gnmi

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePath

func ParsePath(origin, pathToParse, target string) (*gnmi.Path, error)

ParsePath from XPath-like string to gNMI path structure

Types

type Handler

type Handler struct {
	*HandlerConfig
	// contains filtered or unexported fields
}

func (*Handler) AddAlias

func (h *Handler) AddAlias(name, path string)

func (*Handler) AddAliasFromSubscription

func (h *Handler) AddAliasFromSubscription(s Subscription) error

func (*Handler) AddTagSubscription

func (h *Handler) AddTagSubscription(s *TagSubscription)

func (*Handler) Process

func (h *Handler) Process(acc telegraf.Accumulator, source string, response *gnmi.SubscribeResponse)

type HandlerConfig

type HandlerConfig struct {
	EmitDeleteMetrics   bool     `toml:"emit_delete_metrics"`
	CanonicalFieldNames bool     `toml:"canonical_field_names"`
	TrimSlash           bool     `toml:"trim_field_names"`
	TagPathPrefix       bool     `toml:"prefix_tag_key_with_path"`
	GuessPathStrategy   string   `toml:"path_guessing_strategy"`
	VendorExt           []string `toml:"vendor_specific"`
	YangModelPaths      []string `toml:"yang_model_paths"`
}

func (*HandlerConfig) Handler

func (cfg *HandlerConfig) Handler(log telegraf.Logger, options ...Option) (*Handler, error)

type Option

type Option func(*Handler)

func WithDefaultName

func WithDefaultName(name string) Option

func WithEnforceFirstNamespaceAsOrigin

func WithEnforceFirstNamespaceAsOrigin() Option

type Subscription

type Subscription struct {
	Name              string          `toml:"name"`
	Origin            string          `toml:"origin"`
	Path              string          `toml:"path"`
	SubscriptionMode  string          `toml:"subscription_mode"`
	SampleInterval    config.Duration `toml:"sample_interval"`
	SuppressRedundant bool            `toml:"suppress_redundant"`
	HeartbeatInterval config.Duration `toml:"heartbeat_interval"`
	// contains filtered or unexported fields
}

func (*Subscription) Build

func (s *Subscription) Build(origin, prefix, target string) error

func (*Subscription) Request

func (s *Subscription) Request() (*gnmi.Subscription, error)

type TagSubscription

type TagSubscription struct {
	Match    string   `toml:"match"`
	Elements []string `toml:"elements"`
	Subscription
}

Directories

Path Synopsis
extensions

Jump to

Keyboard shortcuts

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