Documentation ¶
Index ¶
- func BindArgs(cmd *cobra.Command)
- func GetStruct(path string, value interface{}) error
- func GetStructWithValidation(path string, value interface{}) error
- func InitConfig() error
- type AgolloZerologAdapter
- type StringMap
- func (m StringMap) GetBool(path string) (bool, error)
- func (m StringMap) GetInt(path string) (int, error)
- func (m StringMap) GetInt64(path string) (int64, error)
- func (m StringMap) GetString(path string) (string, error)
- func (m StringMap) GetStringMap(path string) (StringMap, error)
- func (m StringMap) GetStringMapList(path string) ([]StringMap, error)
- func (m StringMap) GetStruct(path string, value interface{}) error
- func (m StringMap) GetStructWithValidation(path string, value interface{}) error
- func (m StringMap) Mix(src StringMap)
- func (m StringMap) ToRawMap() map[string]interface{}
- func (m StringMap) ToStruct(targetObj interface{}) error
- func (m StringMap) ToStructWithValidation(targetObj interface{}) error
- type TypeAssertionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStructWithValidation ¶
GetStructWithValidation gets Struct object by path in config with validation
Types ¶
type AgolloZerologAdapter ¶
type AgolloZerologAdapter struct { }
func (*AgolloZerologAdapter) Log ¶
func (l *AgolloZerologAdapter) Log(kvs ...interface{})
type StringMap ¶
type StringMap map[string]interface{}
StringMap defines config map type
func GetStringMap ¶
GetStringMap gets StringMap object by path in config
func (StringMap) GetStringMap ¶
GetStringMap returns a map value of config by path
func (StringMap) GetStringMapList ¶
GetStringMapList returns a list value of config by path
func (StringMap) GetStructWithValidation ¶
GetStructWithValidation returns a struct value of config by path with validation
func (StringMap) Mix ¶
Mix mixes in src config to dst config, overriding collisions in dst config map
func (StringMap) ToStruct ¶
ToStruct converts config to generic interface, copying all config values
func (StringMap) ToStructWithValidation ¶
ToStructWithValidation converts config object to config map with field values validation
type TypeAssertionError ¶
type TypeAssertionError struct { Value interface{} TargetType string }
TypeAssertionError describes type assertion error, used to generate type convertion errors
func (TypeAssertionError) Error ¶
func (e TypeAssertionError) Error() string
Error returns type convertion error