Documentation ¶
Overview ¶
Package envconf simplifies reading and writing environment variables. A typical use is using environment variables for configuration settings.
Use of this source code is governed by the MIT License that can be found in the LICENSE file.
Index ¶
- func GetBool(key string) (value bool, ok bool)
- func GetDuration(key string) (value time.Duration, ok bool)
- func GetFloat64(key string) (value float64, ok bool)
- func GetInt(key string) (value int, ok bool)
- func GetInt64(key string) (value int64, ok bool)
- func GetPrefix() string
- func GetString(key string) (value string, ok bool)
- func GetUInt(key string) (value uint, ok bool)
- func GetUInt64(key string) (value uint64, ok bool)
- func IssetKey(key string) bool
- func MustGetBool(key string) (value bool)
- func MustGetDuration(key string) time.Duration
- func MustGetFloat64(key string) float64
- func MustGetInt(key string) (value int)
- func MustGetInt64(key string) (value int64)
- func MustGetString(key string) (value string)
- func MustGetUInt(key string) (value uint)
- func MustGetUInt64(key string) (value uint64)
- func SetBool(key string, value bool)
- func SetDefaultBool(key string, value bool)
- func SetDefaultDuration(key string, value time.Duration)
- func SetDefaultFloat64(key string, value float64)
- func SetDefaultInt(key string, value int)
- func SetDefaultInt64(key string, value int64)
- func SetDefaultString(key string, value string)
- func SetDefaultUInt(key string, value uint)
- func SetDefaultUInt64(key string, value uint64)
- func SetDuration(key string, value time.Duration)
- func SetFloat64(key string, value float64)
- func SetInt(key string, value int)
- func SetInt64(key string, value int64)
- func SetPrefix(p string)
- func SetString(key string, value string)
- func SetUInt(key string, value uint)
- func SetUInt64(key string, value uint64)
- func UnsetKey(key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDuration ¶
GetDuration returns the environment parsed as time.Duration.
func GetFloat64 ¶
GetFloat64 returns the environment parsed as float64.
func GetPrefix ¶
func GetPrefix() string
GetPrefix returns the prefix that is automatically prepended to a environment variable.
func GetString ¶
GetString returns the environment parsed as string. Returns an empty string if the environment does not exists or could not be parsed.
func MustGetBool ¶
MustGetBool returns the environment variable parsed as bool if possible, otherwise it panics.
func MustGetDuration ¶
MustGetDuration returns the environment variable parsed as time.Duration if possible, otherwise it panics.
func MustGetFloat64 ¶
MustGetFloat64 returns the environment variable parsed as float64 if possible, otherwise it panics.
func MustGetInt ¶
MustGetInt returns the environment variable parsed as int if possible, otherwise it panics.
func MustGetInt64 ¶
MustGetInt64 returns the environment variable parsed as int64 if possible, otherwise it panics.
func MustGetString ¶
MustGetString returns the environment variable parsed as string if possible, otherwise it panics.
func MustGetUInt ¶
MustGetUInt returns the environment variable parsed as uint if possible, otherwise it panics.
func MustGetUInt64 ¶
MustGetUInt64 returns the environment variable parsed as uint64 if possible, otherwise it panics.
func SetDefaultBool ¶
SetDefaultBool sets the environment if it is not already set.
func SetDefaultDuration ¶
SetDefaultDuration sets the environment if it is not already set.
func SetDefaultFloat64 ¶
SetDefaultFloat64 sets the environment if it is not already set.
func SetDefaultInt ¶
SetDefaultInt sets the environment if it is not already set.
func SetDefaultInt64 ¶
SetDefaultInt64 sets the environment if it is not already set.
func SetDefaultString ¶
SetDefaultString sets the environment if it is not already set.
func SetDefaultUInt ¶
SetDefaultUInt sets the environment if it is not already set.
func SetDefaultUInt64 ¶
SetDefaultUInt64 sets the environment if it is not already set.
func SetDuration ¶
SetDuration sets the environment.
Types ¶
This section is empty.