Documentation ¶
Index ¶
- func Decode(bts []byte, ptr interface{}) error
- func DecodeReader(r io.Reader, ptr interface{}) error
- func DecodeString(str string, ptr interface{}) error
- func Encode(v interface{}) ([]byte, error)
- func EncodePretty(v interface{}) ([]byte, error)
- func EncodeToWriter(v interface{}, w io.Writer) error
- func EncodeUnescapeHTML(v interface{}) ([]byte, error)
- func Mapping(src, dst interface{}) error
- func Pretty(v interface{}) (string, error)
- func ReadFile(filePath string, v interface{}) error
- func StripComments(src string) string
- func WriteFile(filePath string, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeReader ¶ added in v0.4.3
DecodeReader decode JSON from io reader.
func DecodeString ¶ added in v0.5.0
DecodeString json string to data ptr.
func EncodePretty ¶ added in v0.5.2
EncodePretty encode pretty JSON data to json bytes.
func EncodeToWriter ¶ added in v0.5.0
EncodeToWriter encode data to writer.
func EncodeUnescapeHTML ¶ added in v0.5.0
EncodeUnescapeHTML data to json bytes. will close escape HTML
func Mapping ¶ added in v0.5.3
func Mapping(src, dst interface{}) error
Mapping src data(map,struct) to dst struct use json tags.
On src, dst both is struct, equivalent to merging two structures (src should be a subset of dsc)
func StripComments ¶ added in v0.1.3
StripComments strip comments for a JSON string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.