Documentation ¶
Index ¶
- Variables
- func Get(key string) interface{}
- func GetBool(key string) bool
- func GetInt(key string) int
- func GetMapStringBool(key string) map[string]bool
- func GetMapStringInt(key string) map[string]int
- func GetMapStringInterface(key string) map[string]interface{}
- func GetMapStringString(key string) map[string]string
- func GetString(key string) string
- func Merge(in []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( // BaseConfig is the default configuration. // Configuration that is expected to be overridden by environment variables should be at the root level // and be simple values. Secrets should (probably) come from the environment and not be comitted with code. BaseConfig = map[string]interface{}{} // EnvMap maps a BaseConfig key onto the Environmental Key that overrides it. // Environmental configurations must be strings in the BaseConfig, though you can use the Get* // to convert to a desired type. // Environmental configs are those things which are: // * Vital to the functionality of the service; or // * Secret in nature // ex: // "host": "HOST", // "port": "PORT", // "defaultTimeout": "TIMEOUT", // "env": "ENV", // "dbConnectString": "DB_CONNECT_STRING", EnvMap = map[string]string{} )
Functions ¶
func Get ¶
func Get(key string) interface{}
Get returns the value of the given configuration element at the specified key as the JSON Type as it exists at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetBool ¶
GetBool returns the value of the given configuration element at the specified key as an bool, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetInt ¶
GetInt returns the value of the given configuration element at the specified key as an int, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetMapStringBool ¶
GetMapStringBool returns the value of the given configuration element at the specified key as map[string]bool, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetMapStringInt ¶
GetMapStringInt returns the value of the given configuration element at the specified key as map[string]int, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetMapStringInterface ¶
GetMapStringInterface returns the value of the given configuration element at the specified key as map[string]interface{}, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetMapStringString ¶
GetMapStringString returns the value of the given configuration element at the specified key as map[string]string, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
func GetString ¶
GetString returns the value of the given configuration element at the specified key as a string, regardless of the original type at that key. Key is a valid JSON Path (https://goessner.net/articles/JsonPath/)
Types ¶
This section is empty.