config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: MIT Imports: 4 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "v1.1.3"

Functions

This section is empty.

Types

type Config

type Config struct {
	RollbarToken string
	GoEnv        string `default:"development"`
	Version      string `ignore:"true"`
	NetnsPrefix  string `default:"sc-ns-"`
	NetnsPath    string `default:"/var/run/netns"`
	HTTPPort     int    `envconfig:"PORT" default:"9999"`

	// Deprecated: use PeerHostname
	PublicHostname string `envconfig:"PUBLIC_HOSTNAME"`
	// Deprecated: use PeerIP
	PublicIP string `envconfig:"PUBLIC_IP"`

	// PeerHostname and PeerIP are the hostname and IP address of the current node
	// in the network. It is used to build the overlay network and communicate
	// with other nodes in the network.
	//
	// Use Getter GetPeerHostname() and GetPeerIP() for retrocompat with PublicHostname and PublicIP
	PeerHostname string `envconfig:"PEER_HOSTNAME"`
	PeerIP       string `envconfig:"PEER_IP"`

	// APIHostname is the hostname which should be used to contact a SAND endpoint
	// to communicate with its API
	APIHostname string `envconfig:"API_HOSTNAME"`

	EtcdPrefix    string `default:"/sc-net"`
	EtcdHosts     string `envconfig:"ETCD_HOSTS" default:"http://127.0.0.1:2379"`
	EtcdTLSCACert string `envconfig:"ETCD_CACERT"`
	EtcdTLSKey    string `envconfig:"ETCD_TLS_KEY"`
	EtcdTLSCert   string `envconfig:"ETCD_TLS_CERT"`

	HTTPTLSCert string `envconfig:"HTTP_TLS_CERT"`
	HTTPTLSKey  string `envconfig:"HTTP_TLS_KEY"`
	HTTPTLSCA   string `envconfig:"HTTP_TLS_CA"`

	EnableDockerPlugin   bool `envconfig:"ENABLE_DOCKER_PLUGIN"`
	DockerPluginHttpPort int  `default:"9998"`

	MaxVNI int `envconfig:"MAX_VNI" default:"999_999"`
}

func Build

func Build() (*Config, error)

func (*Config) CreateDirectories

func (c *Config) CreateDirectories() error

func (*Config) GetPeerHostname added in v1.1.0

func (c *Config) GetPeerHostname() string

func (*Config) GetPeerIP added in v1.1.0

func (c *Config) GetPeerIP() string

func (*Config) IsHttpTLSEnabled added in v0.5.3

func (c *Config) IsHttpTLSEnabled() bool

Jump to

Keyboard shortcuts

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