Documentation ¶
Index ¶
- func GetBoolFromEnvVar(name string, defaultValue bool) (bool, error)
- func GetDurationFromEnvVar(name string, defaultValue time.Duration) (time.Duration, error)
- func GetEnvVar(name, defaultValue string) string
- func GetIPNetSliceFromEnvVar(name string, defaultValue []net.IPNet) ([]net.IPNet, error)
- func GetIntFromEnvVar(name string, defaultValue int) (int, error)
- func GetRequiredEnvVar(name string) (string, error)
- func GetRequiredIntFromEnvVar(name string) (int, error)
- func GetStringSliceFromEnvVar(name string, defaultValue []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBoolFromEnvVar ¶
GetBoolFromEnvVar attempts to parse a bool from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as a bool.
func GetDurationFromEnvVar ¶
GetDurationFromEnvVar attempts to parse a time.Duration from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as a time.Duration.
func GetEnvVar ¶
GetEnvVar retrieves the value of an environment variable having the specified name. If that value is the empty string, a specified default is returned instead.
func GetIPNetSliceFromEnvVar ¶
GetIPNetSliceFromEnvVar retrieves comma-delimited values from an environment variable having the specified name and attempts to parse those into a slice of net.IP.
func GetIntFromEnvVar ¶
GetIntFromEnvVar attempts to parse an integer from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as an integer.
func GetRequiredEnvVar ¶
GetRequiredEnvVar retrieves the value of an environment variable having the specified name. If that value is the empty string, an error is returned.
func GetRequiredIntFromEnvVar ¶ added in v0.3.0
GetRequiredIntFromEnvVar attempts to parse an integer from a string value retrieved from the specified environment variable. An error is returned if the string value cannot successfully be parsed as an integer. An error is also returned if the string value was the empty string.
func GetStringSliceFromEnvVar ¶
GetStringSliceFromEnvVar retrieves comma-delimited values from an environment variable having the specified name and populates a string slice.
Types ¶
This section is empty.