Documentation ¶
Overview ¶
Package jsonenc support encoding and decoding instance by json.
Index ¶
- Constants
- Variables
- func Marshal(v interface{}) ([]byte, error)
- func MarshalIndent(i interface{}) ([]byte, error)
- func MustMarshal(i interface{}) []byte
- func MustMarshalIndent(i interface{}) []byte
- func ToString(i interface{}) string
- func Unmarshal(b []byte, v interface{}) error
- type Encoder
- func (enc *Encoder) Add(ht hint.Hinter) error
- func (enc *Encoder) Decode(b []byte) (hint.Hinter, error)
- func (enc *Encoder) DecodeMap(b []byte) (map[string]hint.Hinter, error)
- func (enc *Encoder) DecodeSlice(b []byte) ([]hint.Hinter, error)
- func (enc *Encoder) DecodeWithHint(b []byte, ht hint.Hint) (hint.Hinter, error)
- func (*Encoder) Hint() hint.Hint
- func (*Encoder) Marshal(v interface{}) ([]byte, error)
- func (*Encoder) Unmarshal(b []byte, v interface{}) error
- type HintedHead
- type Unpackable
Constants ¶
View Source
const (
NULL = "null"
)
Variables ¶
View Source
var ( JSONEncoderType = hint.Type("json-encoder") JSONEncoderHint = hint.NewHint(JSONEncoderType, "v0.0.1") )
Functions ¶
func MarshalIndent ¶
func MustMarshal ¶
func MustMarshal(i interface{}) []byte
func MustMarshalIndent ¶
func MustMarshalIndent(i interface{}) []byte
Types ¶
type HintedHead ¶
func NewHintedHead ¶
func NewHintedHead(h hint.Hint) HintedHead
type Unpackable ¶
Click to show internal directories.
Click to hide internal directories.