Documentation ¶
Overview ¶
Package encoder will replace encoder package with new design :(
Index ¶
- func Decode(b []byte, enc Encoder, target interface{}) error
- func DecodeWithHint(b []byte, enc Encoder, ht hint.Hint, target interface{}) error
- func Ptr(i interface{}) (reflect.Value, reflect.Value)
- type AsyncWriter
- type Encoder
- type Encoders
- func (es *Encoders) AddEncoder(ec Encoder) error
- func (es *Encoders) AddHinter(ht hint.Hinter) error
- func (es *Encoders) AddType(ty hint.Type) error
- func (es *Encoders) Compatible(ht hint.Hint) (hint.Hinter, error)
- func (es *Encoders) Encoder(ty hint.Type, version string) (Encoder, error)
- func (es *Encoders) Initialize() error
- type UnpackFunc
- type Unpacker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeWithHint ¶
Types ¶
type AsyncWriter ¶
type AsyncWriter struct {
// contains filtered or unexported fields
}
func NewAsyncWriter ¶
func NewAsyncWriter(enc Encoder, w io.Writer) *AsyncWriter
type Encoder ¶
type Encoder interface { hint.Hinter Add(hint.Hinter) error Marshal(interface{}) ([]byte, error) Unmarshal([]byte, interface{}) error Decode([]byte) (hint.Hinter, error) // NOTE decode hinted instance DecodeWithHint([]byte, hint.Hint) (hint.Hinter, error) // NOTE decode with hint DecodeSlice([]byte) ([]hint.Hinter, error) // NOTE decode slice of hinted instance DecodeMap([]byte) (map[string]hint.Hinter, error) // NOTE decode string key map of hinted instance }
type Encoders ¶
type Encoders struct { *hint.GlobalHintset // contains filtered or unexported fields }
func NewEncoders ¶
func NewEncoders() *Encoders
func (*Encoders) AddEncoder ¶
func (*Encoders) Initialize ¶
type Unpacker ¶
type Unpacker struct { Elem interface{} N string F UnpackFunc }
func AnalyzeSetHinter ¶
Click to show internal directories.
Click to hide internal directories.