Documentation ¶
Index ¶
- func AddFlag(flags *pflag.FlagSet, name string, vtype reflect.Type, usage string) error
- func FlattenMap(nested map[string]interface{}) (map[string]interface{}, error)
- func FlattenStruct2StringMap(v interface{}) (map[string]interface{}, error)
- func FlattenStructFieldTag(v interface{}, tagName string) (map[string]string, error)
- func FlattenStructReflectType(v interface{}) (map[string]reflect.Type, error)
- func LowerFirst(s string) string
- func LowerFirstInDotString(s string) string
- func Struct2ReflectMap(v interface{}, transformer FieldTransformer) (map[string]interface{}, error)
- func Struct2StringMap(v interface{}) (map[string]interface{}, error)
- type FieldTransformer
- type PathFlag
- type TagParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenMap ¶
FlattenMap flatten map
func FlattenStruct2StringMap ¶
FlattenStruct2StringMap flatten struct to StringMap
func FlattenStructFieldTag ¶
FlattenStructFieldTag flatten struct field tag
func FlattenStructReflectType ¶
FlattenStructReflectType flatten map from Struct2ReflectType
func LowerFirst ¶
func LowerFirstInDotString ¶
LowerFirstInDotString transform from "Extra.LoaderType" to "extra.loaderType"
func Struct2ReflectMap ¶
func Struct2ReflectMap(v interface{}, transformer FieldTransformer) (map[string]interface{}, error)
Struct2ReflectMap convert struct to map contains reflect Infomation
func Struct2StringMap ¶
Struct2StringMap convert struct to map
Types ¶
type FieldTransformer ¶
type FieldTransformer = func(field reflect.StructField) (interface{}, error)
FieldTransformer extract data type from struct field
type PathFlag ¶
type PathFlag struct { // path flag mode RemainArgs []string // contains filtered or unexported fields }
PathFlag will use path flag to specify config file and dot path
type TagParser ¶
type TagParser struct {
// contains filtered or unexported fields
}
TagParser parse field tag string input like `posval,key1=val1,key2=val2`
func (*TagParser) QueryByKey ¶
QueryByKey query value by key
func (*TagParser) QueryByPos ¶
QueryByPos query value by pos
Click to show internal directories.
Click to hide internal directories.