Documentation ¶
Index ¶
- func ConvertDuration(v reflect.Value, dest reflect.Type) (reflect.Value, error)
- func ConvertIntUint(v reflect.Value, dest reflect.Type) (reflect.Value, error)
- func ConvertMapInterface(v reflect.Value, dest reflect.Type) (reflect.Value, error)
- func ConvertQueryValues(v reflect.Value, dest reflect.Type) (reflect.Value, error)
- func ConvertStringToNumber(v reflect.Value, dest reflect.Type) (reflect.Value, error)
- func ConvertTime(v reflect.Value, dest reflect.Type) (reflect.Value, error)
- func UnmarshalSlice(src, dst interface{}, fn UnmarshalScalarFunc) error
- func UnmarshalStruct(src, dst interface{}, name string, fn UnmarshalScalarFunc) error
- type Decoder
- type Encoder
- type Error
- type Field
- type UnmarshalScalarFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertDuration ¶ added in v0.0.5
ConvertDuration returns time.Duration from integer, string or time.Duration
func ConvertIntUint ¶ added in v0.0.14
ConvertIntUint allows conversion from int value to a different int value, and uint value to a different uint value
func ConvertMapInterface ¶ added in v0.0.14
ConvertMapInterface returns map[string]<type> from map[string]interface{} when all types within the interface match the destination type
func ConvertQueryValues ¶ added in v0.0.8
ConvertQueryValues returns a value from a []string
func ConvertStringToNumber ¶ added in v0.0.9
ConvertStringToNumber returns int, uint,float or bool from string
func ConvertTime ¶
ConvertTime returns time.Time and converts a ISO8601 string to a time.Time or empty string to time.Time{}
func UnmarshalSlice ¶ added in v0.0.12
func UnmarshalSlice(src, dst interface{}, fn UnmarshalScalarFunc) error
UnmarshalSlice will decode src into a slice
func UnmarshalStruct ¶
func UnmarshalStruct(src, dst interface{}, name string, fn UnmarshalScalarFunc) error
UnmarshalStruct will decode src into dest field names identified by tag
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(name string, hooks ...UnmarshalScalarFunc) *Decoder
Create a new decoder object with 'name' used as struct tag for interpreting the field name
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
Create a new decoder object with 'name' used as struct tag for interpreting the field name