Documentation
¶
Index ¶
- Constants
- func GetEnv(key string) (string, error)
- func GetEnvOrDefault(key, defaultVal string) string
- func LoadEnv(filenames ...string) error
- func ParseEnvBool(key string) (bool, error)
- func ParseEnvInt(key string) (int, error)
- func ParseEnvTimeDuration(key string) (time.Duration, error)
- func ReadAllEnvs(filenames ...string) (map[string]string, error)
Constants ¶
View Source
const ( Dev = "dev" Prod = "prod" Staging = "staging" )
Variables ¶
This section is empty.
Functions ¶
func GetEnvOrDefault ¶
Same as GetEnv, but with default value.
func LoadEnv ¶
Loads environment variables from the given files. It is intented to be used in development mode. If in dev mode, make sure to load the env vars first, then call other funcs.
func ParseEnvBool ¶
Gets key's value, calling GetEnv and parses to bool. Assumes it is in a specific format - text or a binary representation.
func ParseEnvTimeDuration ¶
Gets and parses key's value to duration.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.