Documentation
¶
Index ¶
- Constants
- func GetAllEnvs(filenames ...string) (map[string]string, error)
- 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)
Constants ¶
View Source
const ( Dev = "dev" Prod = "prod" Staging = "staging" )
Variables ¶
This section is empty.
Functions ¶
func GetAllEnvs ¶ added in v1.1.0
A wrapper func around godotenv read func, handling errors more precisely.
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.