Documentation ¶
Overview ¶
Package config contains utils and structure to load Prisme configurations.
Index ¶
- func GetEnvOrDefault(name string, defaultValue string) string
- func MustGetEnv(name string) string
- func MustParseUrlEnv(name string) *url.URL
- func ParseDurationEnvOrDefault(name string, defaultValue time.Duration) time.Duration
- func ParseIntEnvOrDefault(name string, defaultValue int64, bitSize int) int64
- func ParseUintEnvOrDefault(name string, defaultValue uint64, bitSize int) uint64
- type Clickhouse
- type Grafana
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvOrDefault ¶
GetEnvOrDefault reads environment variable with the given name and return it. If variable is not set, defaultValue is returned.
func MustGetEnv ¶
MustGetEnv reads environment variable with the given name and return it. If variable is not set, this function panics.
func MustParseUrlEnv ¶
MustParseUrlEnv reads and environment variable with the given name and parses it as an URL. If variable is not set, this function panics. If variable value is not a valid URL, this function panics.
func ParseDurationEnvOrDefault ¶
ParseUintEnvOrDefault reads environment variable with the given name and parses it as a duration. If variable is not set, defaultValue is returned. If variable value is not a valid duration, this function panics.
func ParseIntEnvOrDefault ¶
ParseIntEnvOrDefault reads environment variable with the given name and parses it as an signed integer. If variable is not set, defaultValue is returned. If variable value is not a valid signed integer, this function panics.
func ParseUintEnvOrDefault ¶
ParseUintEnvOrDefault reads environment variable with the given name and parses it as an unsigned integer. If variable is not set, defaultValue is returned. If variable value is not a valid unsigned integer, this function panics.
Types ¶
type Clickhouse ¶
type Clickhouse struct { TlsEnabled bool HostPort string Database string User secrecy.SecretString Password secrecy.SecretString }
Clickhouse connection options.
func ClickhouseFromEnv ¶
func ClickhouseFromEnv() Clickhouse
ClickhouseFromEnv loads clickhouse config from environment variables. This function panics if required environment variables are missing.
type Grafana ¶
type Grafana struct { Url string User secrecy.SecretString Password secrecy.SecretString OrgId int64 }
Grafana related options.
func GrafanaFromEnv ¶
func GrafanaFromEnv() Grafana
GrafanaFromEnv loads grafana related options from environment variables. This function panics if required environment variables are missing.
type Server ¶
type Server struct { // Access log file path. AccessLog string // Sets log level to debug. Debug bool // Listening port. Port uint16 // Trust proxy headers. TrustProxy bool // X-Forwarded-For proxy header. ProxyHeader string // host:port address of admin http server. AdminHostPort string // Timeout for /api/v1/events/* handlers. ApiEventsTimeout time.Duration }
Server specific options.
func ServerFromEnv ¶
func ServerFromEnv() Server
ServerFromEnv loads server related options from environment variables.