Documentation
¶
Index ¶
- Variables
- func Bool(keys ...string) bool
- func BoolOr(defaultVal bool, keys ...string) bool
- func Exists(keys ...string) bool
- func Float(keys ...string) float64
- func FloatOr(defaultVal float64, keys ...string) float64
- func Int(keys ...string) int
- func IntOr(defaultVal int, keys ...string) int
- func Interface(keys ...string) interface{}
- func Map(keys ...string) map[string]interface{}
- func MustExist(key string)
- func String(keys ...string) string
- func StringOr(defaultVal string, keys ...string) string
- func StringSlice(keys ...string) []string
- func StringSliceOr(defaultVal []string, keys ...string) []string
- func Struct(addr interface{}, keys ...string)
Constants ¶
This section is empty.
Variables ¶
var FileOrder = []string{
"./config/production.yaml",
"./config/production.json",
"production.yaml",
"production.json",
"./config/dev.yaml",
"./config/dev.json",
"dev.yaml",
"dev.json",
"./config/config.yaml",
"./config/config.json",
"config.yaml",
"config.json",
}
FileOrder contains the name, path and order in which the configuration files will be read. The first file will have highest priority
var ShowFiles = false
ShowFiles if set to true, will output the files to StdOut which were read to build the overall configuration
Functions ¶
func BoolOr ¶
BoolOr returns the bool value at the given key. If key is missing it returns defaultVal
func FloatOr ¶
FloatOr returns the float64 value at the given key. If key is missing it returns defaultVal
func Interface ¶
func Interface(keys ...string) interface{}
Interface returns the generic value corresponding to a key.
func MustExist ¶
func MustExist(key string)
MustExist panics if the given configuration key is missing
func StringOr ¶
StringOr returns the string value at the given key. If key is missing it returns defaultVal
func StringSlice ¶
StringSlice returns a splice of string at the given key. Panics if the key is not present.
func StringSliceOr ¶
StringSliceOr returns a splice of string at the given key. If key is missing it returns defaultVal.
Types ¶
This section is empty.