Documentation
¶
Overview ¶
Package getenv provide the implementation of a LookupEnv pattern with default value handling
Index ¶
- func Bool(key string, defaultValue bool) bool
- func Int(key string, defaultValue int) int
- func Int64(key string, defaultValue int64) int64
- func IntArray(key string, defaultValue []int) []int
- func String(key string, defaultValue string) string
- func TimeDuration(key string, defaultValue time.Duration) time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool returns the bool value of the environment variable named by the key, or defaultValue if the environment variable is not set. It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False. Any other value returns default value.
func Int ¶
Int returns the int value of the environment variable named by the key, or defaultValue if the environment variable is not set.
func Int64 ¶
Int64 returns the int64 value of the environment variable named by the key, or defaultValue if the environment variable is not set.
func IntArray ¶ added in v0.0.2
IntArray returns an array of integers from the environment variable by the key, or the default value if the environment variable is not set. It accepts any array of int value as long as the array is in a string "[56, 8, 1]" Any other value returns default value.
Types ¶
This section is empty.