extconfig

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = ""
	BuildHash = ""
)

Set via ldflags

Functions

func CI added in v0.17.2

func CI() bool

func FullVersion

func FullVersion() string

func Listen added in v0.6.11

func Listen(addr string, port int32) string

func NewUserAgentTransport

func NewUserAgentTransport(ua string, inner http.RoundTripper) *userAgentTransport

func Resolver

func Resolver() *net.Resolver

func Transport

func Transport() http.RoundTripper

Types

type ExtConfig

type ExtConfig struct {
	Etcd struct {
		Prefix      string `env:"ETCD_PREFIX,default=/gravity"`
		Endpoint    string `env:"ETCD_ENDPOINT,default=localhost:2379"`
		PeerPort    int32  `env:"ETCD_PEER_PORT,default=2380"`
		JoinCluster string `env:"ETCD_JOIN_CLUSTER"`
	}
	Instance struct {
		Identifier string `env:"INSTANCE_IDENTIFIER"`
		IP         string `env:"INSTANCE_IP"`
		Interface  string `env:"INSTANCE_INTERFACE"`
		Listen     string `env:"INSTANCE_LISTEN"`
	}
	LogLevel       string   `env:"LOG_LEVEL,default=info"`
	DataPath       string   `env:"DATA_PATH,default=./data"`
	BootstrapRoles string   `env:"BOOTSTRAP_ROLES,default=dns;dhcp;api;etcd;discovery;backup;monitoring;tsdb;tftp"`
	FallbackDNS    string   `env:"FALLBACK_DNS,default=1.1.1.1:53"`
	ImportConfigs  []string `env:"IMPORT_CONFIGS"`

	Sentry struct {
		DSN     string `env:"SENTRY_DSN,default=https://731a93aa4a1a42a2960ac9eecee628c5@sentry.beryju.org/2"`
		Enabled bool   `env:"SENTRY_ENABLED,default=false"`
	}

	Debug          bool `env:"DEBUG,default=false"`
	ListenOnlyMode bool `env:"LISTEN_ONLY,default=false"`
	CI             bool `env:"CI"`
	// contains filtered or unexported fields
}

func Get

func Get() *ExtConfig

func (*ExtConfig) BuildLogger

func (e *ExtConfig) BuildLogger() *zap.Logger

func (*ExtConfig) BuildLoggerWithLevel

func (e *ExtConfig) BuildLoggerWithLevel(l zapcore.Level) *zap.Logger

func (*ExtConfig) Dirs

func (e *ExtConfig) Dirs() *ExtConfigDirs

func (*ExtConfig) EtcdClient

func (e *ExtConfig) EtcdClient() *storage.Client

func (*ExtConfig) GetIP

func (e *ExtConfig) GetIP() (net.IP, error)

func (*ExtConfig) GetInterfaceForIP added in v0.6.1

func (e *ExtConfig) GetInterfaceForIP(forIp net.IP) (*net.Interface, error)

func (*ExtConfig) Listen

func (e *ExtConfig) Listen(port int32) string

func (*ExtConfig) Logger

func (e *ExtConfig) Logger() *zap.Logger

type ExtConfigDirs

type ExtConfigDirs struct {
	EtcdDir      string `json:"etcdDir"`
	CertDir      string `json:"certDir"`
	BackupDir    string `json:"backupDir"`
	TFTPLocalDir string `json:"tftpLocalDir"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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