type RawMessage … // Unmarshal adapts to json/encoding Unmarshal API // // Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by v. // Refer to https://godoc.org/encoding/json#Unmarshal for more information func Unmarshal(data []byte, v interface{ … } // UnmarshalFromString is a convenient method to read from string instead of []byte func UnmarshalFromString(str string, v interface{ … } // Get quick method to get value from deeply nested JSON structure func Get(data []byte, path ...interface{ … } // Marshal adapts to json/encoding Marshal API // // Marshal returns the JSON encoding of v, adapts to json/encoding Marshal API // Refer to https://godoc.org/encoding/json#Marshal for more information func Marshal(v interface{ … } // MarshalIndent same as json.MarshalIndent. Prefix is not supported. func MarshalIndent(v interface{ … } // MarshalToString convenient method to write as string instead of []byte func MarshalToString(v interface{ … } // NewDecoder adapts to json/stream NewDecoder API. // // NewDecoder returns a new decoder that reads from r. // // Instead of a json/encoding Decoder, an Decoder is returned // Refer to https://godoc.org/encoding/json#NewDecoder for more information func NewDecoder(reader io.Reader) *Decoder { … } type Decoder … // Decode decode JSON into interface{} func (adapter *Decoder) Decode(obj interface{ … } // More is there more? func (adapter *Decoder) More() bool { … } // Buffered remaining buffer func (adapter *Decoder) Buffered() io.Reader { … } // UseNumber causes the Decoder to unmarshal a number into an interface{} as a // Number instead of as a float64. func (adapter *Decoder) UseNumber() { … } // DisallowUnknownFields causes the Decoder to return an error when the destination // is a struct and the input contains object keys which do not match any // non-ignored, exported fields in the destination. func (adapter *Decoder) DisallowUnknownFields() { … } // NewEncoder same as json.NewEncoder func NewEncoder(writer io.Writer) *Encoder { … } type Encoder … // Encode encode interface{} as JSON to io.Writer func (adapter *Encoder) Encode(val interface{ … } // SetIndent set the indention. Prefix is not supported func (adapter *Encoder) SetIndent(prefix, indent string) { … } // SetEscapeHTML escape html by default, set to false to disable func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) { … } // Valid reports whether data is a valid JSON encoding. func Valid(data []byte) bool { … }