Documentation ¶
Index ¶
- func GetEnvBool(key string, defaultVal bool) bool
- func GetEnvFloat(key string, defaultVal float64, min float64, max float64) float64
- func GetEnvInt(key string, defaultVal int, min int, max int) int
- func GetEnvPassword(key string, defaultVal string) string
- func GetEnvString(key string, defaultVal string) string
- func GetEnvStringFrom(key string, defaultVal string, allowedValues []string) string
- func LoadEnvFromEnvFiles(env string)
- func SetLogLevelFromEnv(key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvBool ¶
GetEnvBool gets env var or fallback, validates range and logs return value. calls log.Fatal when env var does not validate correctly
func GetEnvFloat ¶
GetEnvFloat gets env var or fallback, validates range and logs return value. calls log.Fatal when env var does not validate correctly
func GetEnvInt ¶
GetEnvInt gets env var or fallback, validates range and logs return value. calls log.Fatal when env var does not validate correctly
func GetEnvPassword ¶
GetEnvPassword is GetEnvString, but doesn't log full value, just ****12
func GetEnvString ¶
GetEnvString gets env var or fallback, and logs return value
func GetEnvStringFrom ¶
GetEnvStringFrom gets env var or fallback, validates if value is allowed and logs return value
func LoadEnvFromEnvFiles ¶
func LoadEnvFromEnvFiles(env string)
LoadEnvFromEnvFiles reads .env* files as in convention. See: https://github.com/joho/godotenv#precedence--conventions
func SetLogLevelFromEnv ¶
func SetLogLevelFromEnv(key string)
SetLogLevelFromEnv reads loglevel from env and sets it. for envp, set to: info, warn, fatal, none. Defaults to info.
Types ¶
This section is empty.