Documentation
¶
Overview ¶
Package environment implements functions to read values from environment variables of the OS.
Index ¶
- func GetEnv(key string, defaultVal string) string
- func GetEnvBool(key string, defaultVal bool) bool
- func GetEnvFloat32(key string, defaultVal float32) float32
- func GetEnvFloat64(key string, defaultVal float64) float64
- func GetEnvInt(key string, defaultVal int) int
- func GetEnvMap(prefix string, cutoffPrefix bool) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnv ¶
GetEnv reads a string value from the environment with the given key. If the key is not found, the default value is returned.
func GetEnvBool ¶
GetEnvBool reads a string value from the environment with the given key and returns it as bool. If the key is not found or is not a bool, the default value is returned.
func GetEnvFloat32 ¶ added in v0.10.0
GetEnvFloat32 reads a string value from the environment with the given key and returns it as float32. If the key is not found or is not a float32, the default value is returned.
func GetEnvFloat64 ¶ added in v0.10.0
GetEnvFloat64 reads a string value from the environment with the given key and returns it as float64. If the key is not found or is not a float64, the default value is returned.
Types ¶
This section is empty.