config

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package config provides methods to get configuration parameters from environment variables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                  string        `default:"vfio-server" desc:"name of VFIO Server" split_words:"true"`
	BaseDir               string        `default:"./" desc:"base directory" split_words:"true"`
	ConnectTo             url.URL       `default:"unix:///var/lib/networkservicemesh/nsm.io.sock" desc:"url to connect to" split_words:"true"`
	MaxTokenLifetime      time.Duration `default:"10m" desc:"maximum lifetime of tokens" split_words:"true"`
	LogLevel              string        `default:"INFO" desc:"Log level" split_words:"true"`
	OpenTelemetryEndpoint string        `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint"`

	Services []ServiceConfig `default:"" desc:"list of supported services"`
}

Config holds configuration parameters from environment variables

func (*Config) Process

func (c *Config) Process() error

Process prints and processes env to config

type ServiceConfig

type ServiceConfig struct {
	Name    string
	Domain  string
	Payload string
	MACAddr net.HardwareAddr
	VLANTag int32
	Labels  map[string]string
}

ServiceConfig is a per-service config

func (*ServiceConfig) UnmarshalBinary

func (s *ServiceConfig) UnmarshalBinary(bytes []byte) (err error)

UnmarshalBinary expects string(bytes) to be in format: Name@Domain: { addr: MACAddr; vlan: VLANTag; labels: Labels; payload: Payload; } MACAddr = xx:xx:xx:xx:xx:xx Labels = label_1=value_1&label_2=value_2

Jump to

Keyboard shortcuts

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