Documentation ¶
Index ¶
- type Config
- func (c *Config) Define(key string, dtype DataType)
- func (c *Config) DefineDefault(key string, val string, dtype DataType)
- func (c *Config) DefineMap(key string, dtype DataType)
- func (c *Config) GetBool(key string) bool
- func (c *Config) GetDirectory(key string) string
- func (c *Config) GetDuration(key string) time.Duration
- func (c *Config) GetHex(key string) []byte
- func (c *Config) GetInt(key string) int64
- func (c *Config) GetMapBool(key string) (empty map[string]bool)
- func (c *Config) GetMapDirectory(key string) (empty map[string]string)
- func (c *Config) GetMapDuration(key string) (empty map[string]time.Duration)
- func (c *Config) GetMapHex(key string) (empty map[string][]byte)
- func (c *Config) GetMapInt(key string) (empty map[string]int64)
- func (c *Config) GetMapMapBool(key string) (empty map[string]map[string]bool)
- func (c *Config) GetMapMapDirectory(key string) (empty map[string]map[string]string)
- func (c *Config) GetMapMapDuration(key string) (empty map[string]map[string]time.Duration)
- func (c *Config) GetMapMapHex(key string) (empty map[string]map[string][]byte)
- func (c *Config) GetMapMapInt(key string) (empty map[string]map[string]int64)
- func (c *Config) GetMapMapMapBool(key string) (empty map[string]map[string]map[string]bool)
- func (c *Config) GetMapMapMapDirectory(key string) (empty map[string]map[string]map[string]string)
- func (c *Config) GetMapMapMapDuration(key string) (empty map[string]map[string]map[string]time.Duration)
- func (c *Config) GetMapMapMapHex(key string) (empty map[string]map[string]map[string][]byte)
- func (c *Config) GetMapMapMapInt(key string) (empty map[string]map[string]map[string]int64)
- func (c *Config) GetMapMapMapMapBool(key string) (empty map[string]map[string]map[string]map[string]bool)
- func (c *Config) GetMapMapMapMapDirectory(key string) (empty map[string]map[string]map[string]map[string]string)
- func (c *Config) GetMapMapMapMapDuration(key string) (empty map[string]map[string]map[string]map[string]time.Duration)
- func (c *Config) GetMapMapMapMapHex(key string) (empty map[string]map[string]map[string]map[string][]byte)
- func (c *Config) GetMapMapMapMapInt(key string) (empty map[string]map[string]map[string]map[string]int64)
- func (c *Config) GetMapMapMapMapMapBool(key string) (empty map[string]map[string]map[string]map[string]map[string]bool)
- func (c *Config) GetMapMapMapMapMapDirectory(key string) (empty map[string]map[string]map[string]map[string]map[string]string)
- func (c *Config) GetMapMapMapMapMapDuration(key string) (empty map[string]map[string]map[string]map[string]map[string]time.Duration)
- func (c *Config) GetMapMapMapMapMapHex(key string) (empty map[string]map[string]map[string]map[string]map[string][]byte)
- func (c *Config) GetMapMapMapMapMapInt(key string) (empty map[string]map[string]map[string]map[string]map[string]int64)
- func (c *Config) GetMapMapMapMapMapMetric(key string) (empty map[string]map[string]map[string]map[string]map[string]int64)
- func (c *Config) GetMapMapMapMapMapString(key string) (empty map[string]map[string]map[string]map[string]map[string]string)
- func (c *Config) GetMapMapMapMapMetric(key string) (empty map[string]map[string]map[string]map[string]int64)
- func (c *Config) GetMapMapMapMapString(key string) (empty map[string]map[string]map[string]map[string]string)
- func (c *Config) GetMapMapMapMetric(key string) (empty map[string]map[string]map[string]int64)
- func (c *Config) GetMapMapMapString(key string) (empty map[string]map[string]map[string]string)
- func (c *Config) GetMapMapMetric(key string) (empty map[string]map[string]int64)
- func (c *Config) GetMapMapString(key string) (empty map[string]map[string]string)
- func (c *Config) GetMapMetric(key string) (empty map[string]int64)
- func (c *Config) GetMapString(key string) (empty map[string]string)
- func (c *Config) GetMetric(key string) int64
- func (c *Config) GetString(key string) string
- func (c *Config) Parse()
- func (c *Config) Status() (ok bool)
- func (c *Config) StatusHelp() bool
- type DataType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig() *Config
NewConfig returns an envconf.Config that is used to read configuration from environment variables. The environment variables are stored in envconf.Config, so changes to the environment after NewConfig has been called will not be taken into account.
func (*Config) Define ¶
Define the type of an environment variable. Variables without a defined type will be ignored by Parse.
func (*Config) DefineDefault ¶
Define the type and default value of an environment variable. Variables without a defined type will be ignored by Parse.
func (*Config) DefineMap ¶ added in v0.1.41
Define the type of an environment variable. Variables without a defined type will be ignored by Parse.
func (*Config) GetBool ¶
Returns the value of an environment variable. If the variable is not defined as envconf.TypeBool the function will return false.
func (*Config) GetDirectory ¶ added in v0.1.13
Returns the value of an environment variable. If the variable is not defined as envconf.TypeDirectory the function will return the empty string.
func (*Config) GetDuration ¶
Returns the value of an environment variable. If the variable is not defined as envconf.TypeDuration the function will return time.Duration(0).
func (*Config) GetHex ¶ added in v0.1.49
Returns the value of an environment variable. If the variable is not defined as envconf.TypeHex the function will return []byte{}.
func (*Config) GetInt ¶
Returns the value of an environment variable. If the variable is not defined as envconf.TypeInt the function will return 0.
func (*Config) GetMapBool ¶ added in v0.1.41
func (*Config) GetMapDirectory ¶ added in v0.1.71
func (*Config) GetMapDuration ¶ added in v0.1.41
func (*Config) GetMapMapBool ¶ added in v0.1.60
func (*Config) GetMapMapDirectory ¶ added in v0.1.71
func (*Config) GetMapMapDuration ¶ added in v0.1.60
func (*Config) GetMapMapHex ¶ added in v0.1.60
func (*Config) GetMapMapInt ¶ added in v0.1.60
func (*Config) GetMapMapMapBool ¶ added in v0.1.60
func (*Config) GetMapMapMapDirectory ¶ added in v0.1.71
func (*Config) GetMapMapMapDuration ¶ added in v0.1.60
func (*Config) GetMapMapMapHex ¶ added in v0.1.60
func (*Config) GetMapMapMapInt ¶ added in v0.1.60
func (*Config) GetMapMapMapMapBool ¶ added in v0.1.70
func (*Config) GetMapMapMapMapDirectory ¶ added in v0.1.71
func (*Config) GetMapMapMapMapDuration ¶ added in v0.1.70
func (*Config) GetMapMapMapMapHex ¶ added in v0.1.70
func (*Config) GetMapMapMapMapInt ¶ added in v0.1.70
func (*Config) GetMapMapMapMapMapBool ¶ added in v0.1.70
func (*Config) GetMapMapMapMapMapDirectory ¶ added in v0.1.71
func (*Config) GetMapMapMapMapMapDuration ¶ added in v0.1.70
func (*Config) GetMapMapMapMapMapHex ¶ added in v0.1.70
func (*Config) GetMapMapMapMapMapInt ¶ added in v0.1.70
func (*Config) GetMapMapMapMapMapMetric ¶ added in v0.1.71
func (*Config) GetMapMapMapMapMapString ¶ added in v0.1.70
func (*Config) GetMapMapMapMapMetric ¶ added in v0.1.71
func (*Config) GetMapMapMapMapString ¶ added in v0.1.70
func (*Config) GetMapMapMapMetric ¶ added in v0.1.71
func (*Config) GetMapMapMapString ¶ added in v0.1.60
func (*Config) GetMapMapMetric ¶ added in v0.1.71
func (*Config) GetMapMapString ¶ added in v0.1.60
func (*Config) GetMapMetric ¶ added in v0.1.71
func (*Config) GetMapString ¶ added in v0.1.41
func (*Config) GetMetric ¶ added in v0.1.20
Returns the value of an environment variable. If the variable is not defined as envconf.TypeMetric the function will return 0.
func (*Config) GetString ¶
Returns the value of an environment variable. If the variable is not defined as envconf.TypeString the function will return the empty string.
func (*Config) Parse ¶
func (c *Config) Parse()
Parse parses the environment variables previously defined by Define and DefineDefault. Parse should only be called once for a given envconf.Config.
func (*Config) Status ¶
Status prints out failures that occured while parsing the environment to os.Stderr. Variables that have been defined without a default value and are missing from the environment will be considered a failure. If parsing of any of the variables has failed Status will return false.