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 GetIntFromEnvVar(name string, defaultValue int) (int, error)
- func GetRequiredEnvVar(name string) (string, 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 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 GetStringSliceFromEnvVar ¶
GetStringSliceFromEnvVar retrieves comma-delimited values from an environment variable having the specified name and populates a string slice.
Types ¶
This section is empty.