Documentation
¶
Index ¶
- func Get(key, defaultValue string) string
- func GetBool(key string, defaultValue bool) bool
- func GetDuration(key string, defaultValue time.Duration) time.Duration
- func GetFloat64(key string, defaultValue float64) float64
- func GetInt(key string, defaultValue int) int
- func GetInt64(key string, defaultValue int64) int64
- func GetStringSlice(key string, defaultValue []string, sep string) []string
- func GetTrimmed(key, defaultValue string) string
- func GetUint(key string, defaultValue uint) uint
- func GetUint64(key string, defaultValue uint64) uint64
- func Has(key string) bool
- func Lookup(key string) (string, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get retrieves an environment variable value, returning defaultValue if the variable is not set or is set to the empty string. To distinguish "not set" from "set to empty", use Lookup or Has.
func GetBool ¶
GetBool retrieves an environment variable as a boolean, returning defaultValue if not set or invalid
func GetDuration ¶
GetDuration retrieves an environment variable as a duration, returning defaultValue if not set or invalid
func GetFloat64 ¶
GetFloat64 retrieves an environment variable as a float64, returning defaultValue if not set or invalid
func GetInt ¶
GetInt retrieves an environment variable as an integer, returning defaultValue if not set or invalid
func GetInt64 ¶
GetInt64 retrieves an environment variable as an int64, returning defaultValue if not set or invalid
func GetStringSlice ¶
GetStringSlice retrieves a delimited environment variable as a string slice. Returns defaultValue if not set or no valid items found.
func GetTrimmed ¶
GetTrimmed retrieves a trimmed environment variable value, returning defaultValue if not set or empty
func GetUint ¶
GetUint retrieves an environment variable as a uint, returning defaultValue if not set or invalid
func GetUint64 ¶
GetUint64 retrieves an environment variable as a uint64, returning defaultValue if not set or invalid
func Has ¶ added in v0.2.0
Has checks if an environment variable is set (even if empty). Returns true if the variable exists, false otherwise.
Types ¶
This section is empty.