Documentation ¶
Index ¶
- Variables
- func Parse(s interface{}, superTag string) (err error)
- func ReflectArray(field *reflect.StructField, value *reflect.Value, tag string) (err error)
- func ReflectStruct(field *reflect.StructField, value *reflect.Value, tag string) (err error)
- func Reset()
- func SetBoolDefaults(s interface{}, superTag string) (err error)
- func Setup()
- type ReflectFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotAPointer error when not a pointer. ErrNotAPointer = errors.New("Not a pointer") // ErrNotAStruct error when not a struct. ErrNotAStruct = errors.New("Not a struct") // ErrTypeNotSupported error when type not supported. ErrTypeNotSupported = errors.New("Type not supported") // ErrUndefinedTag error when Tag var is not defined. ErrUndefinedTag = errors.New("Undefined tag") // Tag set the main tag. Tag string // TagDefault set tag default. TagDefault string // TagHelper set tag usage. TagHelper string // TagDisabled used to not process an input. TagDisabled string // TagSeparator separe names on environment variables. TagSeparator string // Prefix is a string that would be placed at the beginning of the generated tags. Prefix string // ParseMap points to each of the supported types. ParseMap map[reflect.Kind]ReflectFunc // ParsePakagesTypeMap points to each of the suported pakage or user defined types // and it's priority over ParseMap. ParsePakagesTypeMap map[string]ReflectFunc // ParseNameMap point to name of each fueld and functions are defined by the user // it's priority over ParsePakagesTypeMap and ParseMap. ParseNameMap map[string]ReflectFunc )
Functions ¶
func ReflectArray ¶ added in v1.4.2
ReflectArray is called when the Parse encounters a sub-array in the current structure and then calls Parser again to treat the fields of the sub-array.
func ReflectStruct ¶
ReflectStruct is called when the Parse encounters a sub-structure in the current structure and then calls Parser again to treat the fields of the sub-structure.
func SetBoolDefaults ¶ added in v1.4.2
SetBoolDefaults populates the boolean fields of 's' with cfgDefault values.
Types ¶
type ReflectFunc ¶
ReflectFunc type used to create funcrions to parse struct and tags.
Click to show internal directories.
Click to hide internal directories.