Documentation ¶
Index ¶
- func Bool(env string, def bool) bool
- func Duration(env string, def time.Duration) time.Duration
- func Float32(env string, def float32) float32
- func Float64(env string, def float64) float64
- func Int(env string, def int) int
- func Int32(env string, def int32) int32
- func Int64(env string, def int64) int64
- func String(env, def string) string
- func UseNotifier(n Notifier)
- type Notifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool will return true when the environment applies to the strconv true rules, it returns false if it applies to the strconv false rules. It will return the default value if none of these apply and the notifier will be notified.
func Duration ¶
Duration will try and parse the duration given in the environment variable. If the variable is not set or not a valid duration, the notifier will be notified and the default value will be returned.
func Float32 ¶
Float32 will try and parse the value given in the environment variable as an float32. If the variable is not set or the value is not a valid float32, the notifier will be notified and the default value will be returned.
func Float64 ¶
Float64 will try and parse the value given in the environment variable as an float64. If the variable is not set or the value is not a valid float64, the notifier will be notified and the default value will be returned.
func Int ¶
Int will try and parse the value given in the environment variable as an int. If the variable is not set or the value is not a valid int, the notifier will be notified and the default value will be returned.
func Int32 ¶
Int32 will try and parse the value given in the environment variable as an int32. If the variable is not set or the value is not a valid int32, the notifier will be notified and the default value will be returned.
func Int64 ¶
Int64 will try and parse the value given in the environment variable as an int64. If the variable is not set or the value is not a valid int64, the notifier will be notified and the default value will be returned.
func String ¶
String will return the environment variable when it is not empty. If the value is empty (or not set), the notifier will be notified and the default value will be returned.
func UseNotifier ¶
func UseNotifier(n Notifier)
UseNotifier sets the notifier being used for the package to the given notifier. The default notifier is a nil notifier which does nothing with the notifications.