Documentation ¶
Index ¶
- Variables
- func NilEncoder(_ reflext.StructFielder, _ reflect.Value) (interface{}, error)
- type Codecer
- type DefaultDecoders
- func (dec DefaultDecoders) DecodeArray(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeBool(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeByte(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeCurrency(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeFloat(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeInt(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeJSONRaw(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeLanguage(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeLineString(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeMap(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodePoint(it interface{}, v reflect.Value) error
- func (dec *DefaultDecoders) DecodePtr(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeRawBytes(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeString(it interface{}, v reflect.Value) error
- func (dec *DefaultDecoders) DecodeStruct(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeTime(it interface{}, v reflect.Value) error
- func (dec DefaultDecoders) DecodeUint(it interface{}, v reflect.Value) error
- type DefaultEncoders
- func (enc DefaultEncoders) EncodeArray(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeBool(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeByte(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeFloat(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeInt(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeJSONRaw(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeMap(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc *DefaultEncoders) EncodePtr(sf reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeRawBytes(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeSpatial(st spatial.Type) ValueEncoder
- func (enc DefaultEncoders) EncodeString(sf reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeStringer(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeStruct(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeTime(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- func (enc DefaultEncoders) EncodeUint(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
- type ErrNoDecoder
- type ErrNoEncoder
- type Registry
- func (r *Registry) LookupDecoder(t reflect.Type) (ValueDecoder, error)
- func (r *Registry) LookupEncoder(v reflect.Value) (ValueEncoder, error)
- func (r *Registry) RegisterKindCodec(k reflect.Kind, enc ValueEncoder, dec ValueDecoder)
- func (r *Registry) RegisterKindDecoder(k reflect.Kind, dec ValueDecoder)
- func (r *Registry) RegisterKindEncoder(k reflect.Kind, enc ValueEncoder)
- func (r *Registry) RegisterTypeCodec(t reflect.Type, enc ValueEncoder, dec ValueDecoder)
- func (r *Registry) RegisterTypeDecoder(t reflect.Type, dec ValueDecoder)
- func (r *Registry) RegisterTypeEncoder(t reflect.Type, enc ValueEncoder)
- type ValueCodec
- type ValueDecoder
- type ValueEncoder
Constants ¶
This section is empty.
Variables ¶
var ( DDMMYYYY = regexp.MustCompile(`^\d{4}\-\d{2}\-\d{2}$`) DDMMYYYYHHMMSS = regexp.MustCompile(`^\d{4}\-\d{2}\-\d{2}\s\d{2}\:\d{2}:\d{2}$`) )
date format :
var (
DefaultRegistry = buildDefaultRegistry()
)
DefaultMapper :
Functions ¶
func NilEncoder ¶
func NilEncoder(_ reflext.StructFielder, _ reflect.Value) (interface{}, error)
NilEncoder :
Types ¶
type Codecer ¶ added in v1.0.2
type Codecer interface { RegisterTypeCodec(t reflect.Type, enc ValueEncoder, dec ValueDecoder) RegisterTypeEncoder(t reflect.Type, enc ValueEncoder) RegisterTypeDecoder(t reflect.Type, dec ValueDecoder) RegisterKindEncoder(k reflect.Kind, enc ValueEncoder) RegisterKindDecoder(k reflect.Kind, dec ValueDecoder) LookupEncoder(v reflect.Value) (ValueEncoder, error) LookupDecoder(t reflect.Type) (ValueDecoder, error) }
Codecer :
type DefaultDecoders ¶
type DefaultDecoders struct {
// contains filtered or unexported fields
}
DefaultDecoders :
func (DefaultDecoders) DecodeArray ¶
func (dec DefaultDecoders) DecodeArray(it interface{}, v reflect.Value) error
DecodeArray :
func (DefaultDecoders) DecodeBool ¶
func (dec DefaultDecoders) DecodeBool(it interface{}, v reflect.Value) error
DecodeBool :
func (DefaultDecoders) DecodeByte ¶
func (dec DefaultDecoders) DecodeByte(it interface{}, v reflect.Value) error
DecodeByte :
func (DefaultDecoders) DecodeCurrency ¶
func (dec DefaultDecoders) DecodeCurrency(it interface{}, v reflect.Value) error
DecodeCurrency :
func (DefaultDecoders) DecodeFloat ¶
func (dec DefaultDecoders) DecodeFloat(it interface{}, v reflect.Value) error
DecodeFloat :
func (DefaultDecoders) DecodeInt ¶
func (dec DefaultDecoders) DecodeInt(it interface{}, v reflect.Value) error
DecodeInt :
func (DefaultDecoders) DecodeJSONRaw ¶
func (dec DefaultDecoders) DecodeJSONRaw(it interface{}, v reflect.Value) error
DecodeJSONRaw :
func (DefaultDecoders) DecodeLanguage ¶
func (dec DefaultDecoders) DecodeLanguage(it interface{}, v reflect.Value) error
DecodeLanguage :
func (DefaultDecoders) DecodeLineString ¶
func (dec DefaultDecoders) DecodeLineString(it interface{}, v reflect.Value) error
DecodeLineString :
func (DefaultDecoders) DecodeMap ¶
func (dec DefaultDecoders) DecodeMap(it interface{}, v reflect.Value) error
DecodeMap :
func (DefaultDecoders) DecodePoint ¶
func (dec DefaultDecoders) DecodePoint(it interface{}, v reflect.Value) error
DecodePoint :
func (*DefaultDecoders) DecodePtr ¶
func (dec *DefaultDecoders) DecodePtr(it interface{}, v reflect.Value) error
DecodePtr :
func (DefaultDecoders) DecodeRawBytes ¶
func (dec DefaultDecoders) DecodeRawBytes(it interface{}, v reflect.Value) error
DecodeRawBytes :
func (DefaultDecoders) DecodeString ¶
func (dec DefaultDecoders) DecodeString(it interface{}, v reflect.Value) error
DecodeString :
func (*DefaultDecoders) DecodeStruct ¶
func (dec *DefaultDecoders) DecodeStruct(it interface{}, v reflect.Value) error
DecodeStruct :
func (DefaultDecoders) DecodeTime ¶
func (dec DefaultDecoders) DecodeTime(it interface{}, v reflect.Value) error
DecodeTime :
func (DefaultDecoders) DecodeUint ¶
func (dec DefaultDecoders) DecodeUint(it interface{}, v reflect.Value) error
DecodeUint :
type DefaultEncoders ¶
type DefaultEncoders struct {
// contains filtered or unexported fields
}
DefaultEncoders :
func (DefaultEncoders) EncodeArray ¶
func (enc DefaultEncoders) EncodeArray(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeArray :
func (DefaultEncoders) EncodeBool ¶
func (enc DefaultEncoders) EncodeBool(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeBool :
func (DefaultEncoders) EncodeByte ¶
func (enc DefaultEncoders) EncodeByte(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeByte :
func (DefaultEncoders) EncodeFloat ¶
func (enc DefaultEncoders) EncodeFloat(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeFloat :
func (DefaultEncoders) EncodeInt ¶
func (enc DefaultEncoders) EncodeInt(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeInt :
func (DefaultEncoders) EncodeJSONRaw ¶
func (enc DefaultEncoders) EncodeJSONRaw(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeJSONRaw :
func (DefaultEncoders) EncodeMap ¶
func (enc DefaultEncoders) EncodeMap(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeMap :
func (*DefaultEncoders) EncodePtr ¶
func (enc *DefaultEncoders) EncodePtr(sf reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodePtr :
func (DefaultEncoders) EncodeRawBytes ¶
func (enc DefaultEncoders) EncodeRawBytes(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeRawBytes :
func (DefaultEncoders) EncodeSpatial ¶
func (enc DefaultEncoders) EncodeSpatial(st spatial.Type) ValueEncoder
EncodeSpatial :
func (DefaultEncoders) EncodeString ¶
func (enc DefaultEncoders) EncodeString(sf reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeString :
func (DefaultEncoders) EncodeStringer ¶
func (enc DefaultEncoders) EncodeStringer(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeStringer :
func (DefaultEncoders) EncodeStruct ¶
func (enc DefaultEncoders) EncodeStruct(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeStruct :
func (DefaultEncoders) EncodeTime ¶
func (enc DefaultEncoders) EncodeTime(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeTime :
func (DefaultEncoders) EncodeUint ¶
func (enc DefaultEncoders) EncodeUint(_ reflext.StructFielder, v reflect.Value) (interface{}, error)
EncodeUint :
type ErrNoDecoder ¶
ErrNoDecoder :
func (ErrNoDecoder) Error ¶
func (err ErrNoDecoder) Error() (msg string)
type ErrNoEncoder ¶
ErrNoEncoder :
func (ErrNoEncoder) Error ¶
func (err ErrNoEncoder) Error() (msg string)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry :
func (*Registry) LookupDecoder ¶
func (r *Registry) LookupDecoder(t reflect.Type) (ValueDecoder, error)
LookupDecoder :
func (*Registry) LookupEncoder ¶
func (r *Registry) LookupEncoder(v reflect.Value) (ValueEncoder, error)
LookupEncoder :
func (*Registry) RegisterKindCodec ¶ added in v1.1.1
func (r *Registry) RegisterKindCodec(k reflect.Kind, enc ValueEncoder, dec ValueDecoder)
RegisterKindCodec :
func (*Registry) RegisterKindDecoder ¶ added in v1.1.1
func (r *Registry) RegisterKindDecoder(k reflect.Kind, dec ValueDecoder)
RegisterKindDecoder :
func (*Registry) RegisterKindEncoder ¶ added in v1.1.1
func (r *Registry) RegisterKindEncoder(k reflect.Kind, enc ValueEncoder)
RegisterKindEncoder :
func (*Registry) RegisterTypeCodec ¶ added in v1.1.1
func (r *Registry) RegisterTypeCodec(t reflect.Type, enc ValueEncoder, dec ValueDecoder)
RegisterTypeCodec :
func (*Registry) RegisterTypeDecoder ¶ added in v1.1.1
func (r *Registry) RegisterTypeDecoder(t reflect.Type, dec ValueDecoder)
RegisterTypeDecoder :
func (*Registry) RegisterTypeEncoder ¶ added in v1.1.1
func (r *Registry) RegisterTypeEncoder(t reflect.Type, enc ValueEncoder)
RegisterTypeEncoder :
type ValueCodec ¶
type ValueCodec interface { DecodeValue(interface{}, reflect.Value) error EncodeValue(reflect.Value) (interface{}, error) }
ValueCodec :
type ValueEncoder ¶
type ValueEncoder func(reflext.StructFielder, reflect.Value) (interface{}, error)
ValueEncoder :