Documentation
¶
Index ¶
- func ChkDuration(name string) (time.Duration, bool, error)
- func ChkFloat64(name string) (float64, bool, error)
- func ChkInt(name string) (int, bool, error)
- func ChkString(name string) (string, bool)
- func Duration(name string, defaultValue time.Duration) (time.Duration, error)
- func Float64(name string, defaultValue float64) (float64, error)
- func Int(name string, defaultValue int) (int, error)
- func String(name string, defaultValue string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChkDuration ¶ added in v1.1.0
ChkDuration returns the value of the environment variable with the given name as a time.Duration and true if it is set, otherwise it returns 0 and false.
func ChkFloat64 ¶ added in v1.1.0
ChkFloat64 returns the value of the environment variable with the given name as a float64 and true if it is set, otherwise it returns 0.0 and false.
func ChkInt ¶ added in v1.1.0
ChkInt returns the value of the environment variable with the given name as an integer and true if it is set, otherwise it returns 0 and false.
func ChkString ¶ added in v1.1.0
ChkString returns the value of the environment variable with the given name as a string and true if it is set, otherwise it returns empty string and false.
func Duration ¶
Duration returns the value of the environment variable with the given name as a time.Duration. If the environment variable is not set or cannot be parsed as a time.Duration, the default value is returned.
func Float64 ¶
Float64 returns the value of the environment variable with the given name as a float64. If the environment variable is not set or cannot be parsed as a float64, the default value is returned.
Types ¶
This section is empty.