Documentation ¶
Index ¶
- func MergeCommonMap(base map[interface{}]interface{}, from map[interface{}]interface{}, ...) map[interface{}]interface{}
- func Unpack(properties CommonCfg, config interface{}) error
- func UnpackAndDefaults(properties CommonCfg, config interface{}) error
- func UnpackDefaultsAndValidate(properties CommonCfg, config interface{}) error
- func UnpackFromEnvDefaultsAndValidate(key string, config interface{}) error
- func UnpackFromFile(path string, config interface{}) error
- func UnpackFromFileDefaults(path string, config interface{}) error
- func UnpackFromFileDefaultsAndValidate(path string, config interface{}) error
- func UnpackRaw(content []byte, config interface{}) error
- func UnpackRawAndDefaults(content []byte, config interface{}) error
- func UnpackRawDefaultsAndValidate(content []byte, config interface{}) error
- func UnpackTypeDefaultsAndValidate(configType string, key string, config interface{})
- type CommonCfg
- func MergeCommonCfg(base CommonCfg, from CommonCfg, override bool) CommonCfg
- func MergeCommonCfgListByType(base []CommonCfg, from []CommonCfg, override bool, ignoreFromType bool) []CommonCfg
- func MergeCommonCfgListByTypeAndName(base []CommonCfg, from []CommonCfg, override bool, ignoreFromType bool) []CommonCfg
- func NewCommonCfg() CommonCfg
- func Pack(config interface{}) (CommonCfg, error)
- func PackAndDefault(config interface{}) (CommonCfg, error)
- type ComponentBaseConfig
- type SystemConfig
- 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 UnpackAndDefaults ¶
func UnpackFromEnvDefaultsAndValidate ¶ added in v1.1.0
func UnpackFromFile ¶
func UnpackFromFileDefaults ¶
func UnpackRawAndDefaults ¶
func UnpackTypeDefaultsAndValidate ¶ added in v1.1.0
Types ¶
type CommonCfg ¶
type CommonCfg map[string]interface{}
func MergeCommonCfgListByType ¶
func MergeCommonCfgListByType(base []CommonCfg, from []CommonCfg, override bool, ignoreFromType bool) []CommonCfg
MergeCommonCfgListByType merge commonCfg list ignoreFromType: set ignoreFromType=true, if fromCommonCfg had a type A which does not exist in baseCommonCfg, then type A would not merged to baseCommonCfg
func NewCommonCfg ¶
func NewCommonCfg() CommonCfg
func PackAndDefault ¶
type ComponentBaseConfig ¶
type SystemConfig ¶
type SystemConfig struct {
DbFile string `yaml:"db_file" default:"./data/loggie.db"`
}
Click to show internal directories.
Click to hide internal directories.