config

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 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"`
	RegistryClientPolicies []string          `` /* 187-byte string literal not displayed */
	LogLevel               string            `default:"INFO" desc:"Log level" split_words:"true"`
	OpenTelemetryEndpoint  string            `default:"otel-collector.observability.svc.cluster.local:4317" desc:"OpenTelemetry Collector Endpoint"`
	MetricsExportInterval  time.Duration     `default:"10s" desc:"interval between mertics exports" split_words:"true"`
	CidrPrefix             cidr.Groups       `default:"169.254.0.0/16" desc:"List of CIDR Prefix to assign IPv4 and IPv6 addresses from" split_words:"true"`
	Labels                 map[string]string `default:"" desc:"Endpoint labels"`
	Payload                string            `default:"ETHERNET" desc:"Name of provided service payload" split_words:"true"`

	ServiceNames    []ServiceConfig `default:"" desc:"list of supported services" split_words:"true"`
	RegisterService bool            `default:"true" desc:"if true then registers network service on startup" split_words:"true"`
}

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
	MACAddr net.HardwareAddr
	VLANTag int32
}

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: { addr: MACAddr; vlan: VLANTag; } MACAddr = xx:xx:xx:xx:xx:xx

Jump to

Keyboard shortcuts

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