Documentation ¶
Index ¶
- func Assign(dst, src interface{}) error
- func AssignString(dst interface{}, src string) error
- func AssignStringToValue(dst reflect.Value, src string) (err error)
- func AssignValue(dst, src reflect.Value) (err error)
- func Clear(v interface{})
- func Traverse(v interface{}, process ProcessValue) error
- func TraverseFields(v interface{}, processField ProcessValue) error
- func TraverseValue(v reflect.Value, process ProcessValue) error
- func TraverseValueFields(v reflect.Value, processField ProcessValue) error
- type ProcessValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assign ¶
func Assign(dst, src interface{}) error
Assign tries to convert source to destination. If possible, it converts the string to the destination type.
func AssignString ¶
AssignString tries to convert the string to the appropriate type and assign it to the destination variable.
func AssignStringToValue ¶
AssignStringToValue tries to convert the string to the appropriate type and assign it to the destination variable.
func AssignValue ¶
AssignValue tries to convert source to destination. If possible, it converts the string to the destination type.
func Traverse ¶
func Traverse(v interface{}, process ProcessValue) error
Traverse iterates through all the nested elements of the passed variable.
func TraverseFields ¶
func TraverseFields(v interface{}, processField ProcessValue) error
TraverseFields iterates through all structs's fields of the passed variable.
func TraverseValue ¶
func TraverseValue(v reflect.Value, process ProcessValue) error
TraverseValue iterates through all the nested elements of the passed variable.
func TraverseValueFields ¶
func TraverseValueFields(v reflect.Value, processField ProcessValue) error
TraverseValueFields iterates through all structs's fields of the passed variable.
Types ¶
type ProcessValue ¶
type ProcessValue func(value reflect.Value, path string, level uint, field *reflect.StructField) error
ProcessValue is type of callback function for Traverse function.