simple

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package simple provides a TargetLoader for parsing a simple target YAML config file. Here is an example simple config:

---
connection:
  my-router:
    addresses:
      - my-router.test.example.net:9339
    credentials:
      username: myusername
      password: mypassword
    request: my-request
    meta: {}
request:
  my-request:
    target: *
    paths:
      - /components
      - /interfaces/interface[name=*]/state/counters
      - /qos/interfaces/interface[interface-id=*]/output/queues/queue[name=*]/state

Paths can be further disambiguated with a gNMI Origin prefix, for example:

openconfig-interfaces:/interfaces/interface[name=*]/state/counters

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimpleTargetLoader

func NewSimpleTargetLoader(config *configuration.GatewayConfig) loaders.TargetLoader

Types

type ConnectionConfig

type ConnectionConfig struct {
	Addresses   []string          `yaml:"addresses"`
	Request     string            `yaml:"request"`
	Meta        map[string]string `yaml:"meta"`
	Credentials CredentialsConfig `yaml:"credentials"`
}

type CredentialsConfig added in v0.10.0

type CredentialsConfig struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type RequestConfig

type RequestConfig struct {
	Target string   `yaml:"target"`
	Paths  []string `yaml:"paths"`
}

type SimpleTargetLoader

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

func (*SimpleTargetLoader) GetConfiguration

func (m *SimpleTargetLoader) GetConfiguration() (*targetpb.Configuration, error)

func (*SimpleTargetLoader) Start

func (m *SimpleTargetLoader) Start() error

func (*SimpleTargetLoader) WatchConfiguration

func (m *SimpleTargetLoader) WatchConfiguration(targetChan chan<- *connections.TargetConnectionControl) error

type TargetConfig

type TargetConfig struct {
	Connection map[string]ConnectionConfig `yaml:"connection"`
	Request    map[string]RequestConfig    `yaml:"request"`
}

Jump to

Keyboard shortcuts

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