Documentation ¶
Overview ¶
Package json provides json operations wrapping ignoring stdlib or third-party lib json.
Index ¶
- func Marshal(v interface{}) ([]byte, error)
- func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
- func MarshalToString(v interface{}) (string, error)
- func NewDecoder(reader io.Reader) *json2.Decoder
- func NewEncoder(writer io.Writer) *json2.Encoder
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalFromString(str string, v interface{}) error
- func Valid(data []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
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 MarshalIndent ¶
MarshalIndent same as json.MarshalIndent. Prefix is not supported.
func MarshalToString ¶
MarshalToString convenient method to write as string instead of []byte.
func NewDecoder ¶
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 NewEncoder ¶
NewEncoder same as json.NewEncoder
func Unmarshal ¶
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 UnmarshalFromString ¶
UnmarshalFromString is a convenient method to read from string instead of []byte.
Types ¶
This section is empty.