config

package
v0.0.0-...-08e1117 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONFIG_FILE = "/etc/echopilot/echopilot.json"
View Source
const DEFAULT_HOST = "localhost"
View Source
const DEFAULT_IP = "127.0.0.1"
View Source
const DEFAULT_PORT = 3000
View Source
const DEFAULT_TLS_CERT = "/etc/echopilot/tls/cert.pem"
View Source
const DEFAULT_TLS_ENABLED = true
View Source
const DEFAULT_TLS_KEY = "/etc/echopilot/tls/key.pem"
View Source
const DEFAULT_TLS_SKIP_VERIFY = false

Variables

This section is empty.

Functions

This section is empty.

Types

type ReloadableConfig

type ReloadableConfig struct {
	ConfigFile    option.Option[string] `json:"configFile" env:"ECHOPILOT_CONFIG_FILE"`
	Host          option.Option[string] `json:"serverHost" env:"ECHOPILOT_HOST"`
	IP            option.Option[string] `json:"bindHost" env:"ECHOPILOT_BIND_IP"`
	Port          option.Option[int]    `json:"serverPort" env:"ECHOPILOT_PORT"`
	TlsCert       option.Option[string] `json:"tlsCert" env:"ECHOPILOT_TLS_CERT"`
	TlsKey        option.Option[string] `json:"tlsKey" env:"ECHOPILOT_TLS_KEY"`
	TlsEnabled    option.Option[bool]   `json:"tlsEnabled" env:"ECHOPILOT_TLS_ENABLED"`
	TlsSkipVerify option.Option[bool]   `json:"tlsSkipVerify" env:"ECHOPILOT_TLS_SKIP_VERIFY"`
}

Generic server configuration which can be reloaded on demand.

func NewFullReloadableConfig

func NewFullReloadableConfig(flags *pflag.FlagSet) (*ReloadableConfig, error)

func NewReloadableConfigFromEnv

func NewReloadableConfigFromEnv() (ReloadableConfig, error)

func NewReloadableConfigFromFile

func NewReloadableConfigFromFile(ConfigFile string) (ReloadableConfig, error)

func NewReloadableConfigFromFlags

func NewReloadableConfigFromFlags(flags *pflag.FlagSet) (ReloadableConfig, error)

func (*ReloadableConfig) Finalize

func (r *ReloadableConfig) Finalize() StaticConfig

type ServerConfig

type ServerConfig struct {
	// contains filtered or unexported fields
}

func NewServerConfig

func NewServerConfig(flags *pflag.FlagSet) (*ServerConfig, error)

func (*ServerConfig) GetAddr

func (c *ServerConfig) GetAddr(update bool) (string, error)

func (*ServerConfig) GetHost

func (c *ServerConfig) GetHost(update bool) (string, error)

func (*ServerConfig) GetTlsConfig

func (c *ServerConfig) GetTlsConfig(update bool) (*tls.Config, error)

func (*ServerConfig) GetTlsEnabled

func (esc *ServerConfig) GetTlsEnabled(update bool) (bool, error)

type StaticConfig

type StaticConfig struct {
	ConfigFile    string
	Host          string
	IP            string
	Port          int
	TlsCert       string
	TlsKey        string
	TlsEnabled    bool
	TlsSkipVerify bool
}

Jump to

Keyboard shortcuts

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