Documentation
¶
Overview ¶
Package encoder supports to encode and decode structs in multiple formats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DecodeDetail ¶
type DecodeDetail struct {
Instance interface{}
Decode DecodeFunc
Desc string
Hint hint.Hint
}
func AnalyzeSetHinter ¶
func AnalyzeSetHinter(d DecodeDetail, v interface{}) DecodeDetail
func (DecodeDetail) IsValid ¶
func (d DecodeDetail) IsValid([]byte) error
type Encoder ¶
type Encoder interface {
hint.Hinter
Add(DecodeDetail) error
AddHinter(hint.Hinter) error
Marshal(interface{}) ([]byte, error) // NOTE native marshaler func
Unmarshal([]byte, interface{}) error // NOTE native unmarshaler func
StreamEncoder(io.Writer) util.StreamEncoder
StreamDecoder(io.Reader) util.StreamDecoder
Decode([]byte) (interface{}, error) // NOTE decode by hint inside []byte
DecodeWithHint([]byte, hint.Hint) (interface{}, error) // NOTE decode []byte by given hint
DecodeWithHintType([]byte, hint.Type) (interface{}, error) // NOTE decode []byte by given type
DecodeWithFixedHintType(string, int) (interface{}, error) // NOTE decode string by fixed type size
DecodeSlice([]byte) ([]interface{}, error) // NOTE decode sliced data
}
Click to show internal directories.
Click to hide internal directories.