Documentation ¶
Index ¶
- func MergeCommonMap(base map[interface{}]interface{}, from map[interface{}]interface{}, ...) map[interface{}]interface{}
- func UnpackTypeDefaultsAndValidate(configType string, key string, config interface{})
- type CommonCfg
- type SystemConfig
- type UnPack
- func NewUnpack(raw []byte, config interface{}, err error) *UnPack
- func UnPackFromFile(path string, config interface{}) *UnPack
- func UnPackFromRaw(raw []byte, config interface{}) *UnPack
- func UnpackFromCommonCfg(c CommonCfg, config interface{}) *UnPack
- func UnpackFromEnv(key string, config interface{}) *UnPack
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeCommonMap ¶ added in v1.2.0
func MergeCommonMap(base map[interface{}]interface{}, from map[interface{}]interface{}, override bool) map[interface{}]interface{}
func UnpackTypeDefaultsAndValidate ¶ added in v1.1.0
Types ¶
type CommonCfg ¶
type CommonCfg map[string]interface{}
func MergeCommonCfg ¶
MergeCommonCfg merge `base` map with `from` map
func NewCommonCfg ¶
func NewCommonCfg() CommonCfg
type SystemConfig ¶
type SystemConfig struct {
DbFile string `yaml:"db_file" default:"./data/loggie.db"`
}
type UnPack ¶ added in v1.3.0
type UnPack struct {
// contains filtered or unexported fields
}
func UnPackFromFile ¶ added in v1.3.0
UnPackFromFile create an Unpack struct from file
func UnPackFromRaw ¶ added in v1.3.0
UnPackFromRaw create an Unpack struct from bytes array
func UnpackFromCommonCfg ¶ added in v1.3.0
UnpackFromCommonCfg create an Unpack struct from CommonCfg
func UnpackFromEnv ¶ added in v1.3.0
UnpackFromEnv create an Unpack struct from env
Click to show internal directories.
Click to hide internal directories.