Documentation ¶
Index ¶
- func GetBool(key string, fallback bool) bool
- func GetBytes(key string, fallback []byte) []byte
- func GetDuration(key string, fallback time.Duration) time.Duration
- func GetFloat[T float32 | float64](key string, fallback T) T
- func GetFloats[T float32 | float64](key string, sep string, fallback []T) []T
- func GetFloatsMap[T float32 | float64](key string, sep string, kvSep string, fallback map[string]T) map[string]T
- func GetInt[T int | int16 | int32 | int64](key string, fallback T) T
- func GetInts[T int | int16 | int32 | int64](key string, sep string, fallback []T) []T
- func GetIntsMap[T int | int16 | int32 | int64](key string, sep string, kvSep string, fallback map[string]T) map[string]T
- func GetString(key string, fallback string) string
- func GetStrings(key string, sep string, fallback []string) []string
- func GetStringsMap(key string, sep string, kvSep string, fallback map[string]string) map[string]string
- func GetTime(key, format string, fallback time.Time) time.Time
- func MustBool(key string) bool
- func MustBytes(key string) []byte
- func MustDuration(key string) time.Duration
- func MustFloat[T float32 | float64](key string) T
- func MustFloats[T float32 | float64](key string, sep string) []T
- func MustFloatsMap[T float32 | float64](key string, sep string, kvSep string) map[string]T
- func MustInt[T int | int16 | int32 | int64](key string) T
- func MustInts[T int | int16 | int32 | int64](key string, sep string) []T
- func MustIntsMap[T int | int16 | int32 | int64](key string, sep string, kvSep string) map[string]T
- func MustString(key string) string
- func MustStrings(key string, sep string) []string
- func MustStringsMap(key string, sep string, kvSep string) map[string]string
- func MustTime(key string, format string) time.Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBool ¶
GetBool func returns environment variable value as a boolean value, If variable doesn't exist or is not set, returns fallback value
func GetBytes ¶ added in v0.1.1
GetBytes func returns environment variable value as a bytes slice If variable doesn't exist or is not set, returns fallback value
func GetDuration ¶
GetDuration func returns environment variable value as a parsed duration value, If variable doesn't exist, is not set or unparsable, returns fallback value
func GetFloat ¶
GetFloat func returns environment variable value as a float value, If variable doesn't exist or is not set, returns fallback value
func GetFloats ¶ added in v1.0.2
GetFloats func returns environment variable value as a float slice If variable doesn't exist or is not set, returns fallback value
func GetFloatsMap ¶ added in v1.0.2
func GetFloatsMap[T float32 | float64](key string, sep string, kvSep string, fallback map[string]T) map[string]T
GetFloatsMap func returns environment variable value as a map[string]float[32|64] If variable doesn't exist or is not set, returns fallback value Example: key=1.2,key2=0.3 sep - key value separator, default is "," kvSep - key value separator, default is "="
func GetInt ¶
GetInt func returns environment variable value as a integer value, If variable doesn't exist or is not set, returns fallback value
func GetInts ¶ added in v1.0.2
GetInts func returns environment variable value as a integer slice If variable doesn't exist or is not set, returns fallback value
func GetIntsMap ¶ added in v1.0.2
func GetIntsMap[T int | int16 | int32 | int64](key string, sep string, kvSep string, fallback map[string]T) map[string]T
GetIntsMap func returns environment variable value as a map[string]int[16|32|64] If variable doesn't exist or is not set, returns fallback value Example: key=2,key2=32 sep - key value separator, default is "," kvSep - key value separator, default is "="
func GetString ¶
GetString func returns environment variable value as a string value, If variable doesn't exist or is not set, returns fallback value
func GetStrings ¶ added in v1.0.2
GetStrings func returns environment variable value as a string slice If variable doesn't exist or is not set, returns fallback value
func GetStringsMap ¶ added in v1.0.2
func GetStringsMap(key string, sep string, kvSep string, fallback map[string]string) map[string]string
GetStringsMap func returns environment variable value as a map[string]string If variable doesn't exist or is not set, returns fallback value Example: key=value1,key2=value2 sep - key value separator, default is "," kvSep - key value separator, default is "="
func GetTime ¶ added in v1.0.0
GetTime func returns environment variable value as a parsed time value, If variable doesn't exist, is not set or unparsable, returns fallback value. If format is empty, then time.RFC3339 is used.
func MustBool ¶
MustBool func returns environment variable value as a boolean value, If variable doesn't exist or is not set, exits from the runtime
func MustBytes ¶ added in v0.1.1
MustBytes func returns environment variable value as a bytes slice. If variable doesn't exist or is not set, exits from the runtime.
func MustDuration ¶
MustDuration func returns environment variable value as a parsed duration value, If variable doesn't exist, is not set or unparsable, then panics
func MustFloat ¶
MustFloat func returns environment variable value as a float value, If variable doesn't exist or is not set, exits from the runtime
func MustFloats ¶ added in v1.0.2
MustFloats func returns environment variable value as a float slice. If variable doesn't exist or is not set, exits from the runtime.
func MustFloatsMap ¶ added in v1.0.2
MustFloatsMap func returns environment variable value as a map[string]float[32|64] If variable doesn't exist or is not set, exits from the runtime. Example: key=1.2,key2=0.3 sep - key value separator, default is "," kvSep - key value separator, default is "="
func MustInt ¶
MustInt func returns environment variable value as an integer value, If variable doesn't exist or is not set, exits from the runtime
func MustInts ¶ added in v1.0.2
MustInts func returns environment variable value as an integer slice. If variable doesn't exist or is not set, exits from the runtime.
func MustIntsMap ¶ added in v1.0.2
MustIntsMap func returns environment variable value as a map[string]int[16|32|64] If variable doesn't exist or is not set, exits from the runtime. Example: key=2,key2=32 sep - key value separator, default is "," kvSep - key value separator, default is "="
func MustString ¶
MustString func returns environment variable value as a string value, If variable doesn't exist or is not set, exits from the runtime
func MustStrings ¶ added in v1.0.2
MustStrings func returns environment variable value as a string slice. If variable doesn't exist or is not set, exits from the runtime.
func MustStringsMap ¶ added in v1.0.2
MustStringsMap func returns environment variable value as a string map. If variable doesn't exist or is not set, exits from the runtime.
func MustTime ¶ added in v1.0.0
MustTime func returns environment variable value as a parsed time value, If variable doesn't exist, is not set or unparsable, then panics. If format is empty, then time.RFC3339 is used. See default time formats: https://golang.org/pkg/time/#pkg-constants
Types ¶
This section is empty.