config

package
v0.0.0-...-d6c69f2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config = &configuration{
		Server: server{
			Address:                 "127.0.0.1",
			Port:                    defaultPoseidonPort,
			SystemdSocketActivation: false,
			Token:                   "",
			TLS: TLS{
				Active:   false,
				CAFile:   "",
				CertFile: "",
				KeyFile:  "",
			},
			InteractiveStderr: true,
			TemplateJobFile:   "",
			Alert: alert{
				PrewarmingPoolThreshold:     0,
				PrewarmingPoolReloadTimeout: 0,
			},
			LoggingFilterToken: randomFilterToken(),
		},
		Nomad: Nomad{
			Enabled: true,
			Address: "127.0.0.1",
			Port:    defaultNomadPort,
			Token:   "",
			TLS: TLS{
				Active:   false,
				CAFile:   "",
				CertFile: "",
				KeyFile:  "",
			},
			Namespace:        "default",
			DisableForcePull: false,
			Network: nomadApi.NetworkResource{
				Mode: "bridge",
				DNS:  nil,
			},
		},
		AWS: AWS{
			Enabled:   false,
			Endpoint:  "",
			Functions: []string{},
		},
		Logger: Logger{
			Level:     "INFO",
			Formatter: dto.FormatterText,
		},
		Profiling: Profiling{
			MemoryThreshold: defaultMemoryUsageAlertThreshold,
		},
		Sentry: sentry.ClientOptions{
			AttachStacktrace: true,
		},
		InfluxDB: InfluxDB{
			URL:          "",
			Token:        "",
			Organization: "",
			Bucket:       "",
			Stage:        "",
		},
	}

	TLSConfig = &tls.Config{
		MinVersion:       tls.VersionTLS13,
		CurvePreferences: []tls.CurveID{tls.CurveP521, tls.CurveP384, tls.CurveP256},
	}
	ErrConfigInitialized = errors.New("configuration is already initialized")
)

Config contains the default configuration of Poseidon.

Functions

func InitConfig

func InitConfig() error

InitConfig merges configuration options from environment variables and a configuration file into the default configuration. Calls of InitConfig after the first call have no effect and return an error. InitConfig should be called directly after starting the program.

Types

type AWS

type AWS struct {
	Enabled   bool     `yaml:"enabled"`
	Endpoint  string   `yaml:"endpoint"`
	Functions []string `yaml:"functions"`
}

AWS configures the AWS Lambda usage.

type InfluxDB

type InfluxDB struct {
	URL          string `yaml:"url"`
	Token        string `yaml:"token"`
	Organization string `yaml:"organization"`
	Bucket       string `yaml:"bucket"`
	Stage        string `yaml:"stage"`
}

InfluxDB configures the usage of an Influx db monitoring.

type Logger

type Logger struct {
	Formatter dto.Formatter `yaml:"formatter"`
	Level     string        `yaml:"level"`
}

Logger configures the used Logger.

type Nomad

type Nomad struct {
	Enabled          bool                     `yaml:"enabled"`
	Address          string                   `yaml:"address"`
	Port             int                      `yaml:"port"`
	Token            string                   `yaml:"token"`
	TLS              TLS                      `yaml:"tls"`
	Namespace        string                   `yaml:"namespace"`
	DisableForcePull bool                     `yaml:"disableforcepull"`
	Network          nomadApi.NetworkResource `yaml:"network"`
}

Nomad configures the used Nomad cluster.

func (*Nomad) URL

func (n *Nomad) URL() *url.URL

URL returns the URL for the configured Nomad cluster.

type Profiling

type Profiling struct {
	CPUEnabled      bool   `yaml:"cpuenabled"`
	CPUFile         string `yaml:"cpufile"`
	MemoryInterval  uint   `yaml:"memoryinterval"`
	MemoryThreshold uint   `yaml:"memorythreshold"`
}

Profiling configures the usage of a runtime profiler to create optimized binaries.

type TLS

type TLS struct {
	Active   bool   `yaml:"active"`
	CAFile   string `yaml:"cafile"`
	CertFile string `yaml:"certfile"`
	KeyFile  string `yaml:"keyfile"`
}

TLS configures TLS on a connection.

Jump to

Keyboard shortcuts

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