Documentation
¶
Index ¶
- Variables
- func AddExtension(extension extension.Extension)
- func Decode(jsonString string, destination interface{}, extensions ...extension.Extension) error
- func DecodeWithTag(tag string, jsonString string, destination interface{}, ...) error
- func Encode(goObject interface{}, pretty bool, extensions ...extension.Extension) (string, error)
- func EncodeWithTag(tag string, goObject interface{}, pretty bool, ...) (string, error)
- func SetTagName(newTagName string)
Constants ¶
This section is empty.
Variables ¶
var DefaultExtensions []extension.Extension
var DefaultTag string = "json"
DefaultTag is used as json Key for structs. By default, ESON uses the `json` tag
Functions ¶
func AddExtension ¶ added in v1.0.5
func Decode ¶
Decode the string provided to the destination object. you can add extensions to use instead of the default extensions by including them as parameters to this function.
func DecodeWithTag ¶ added in v1.0.4
func DecodeWithTag(tag string, jsonString string, destination interface{}, extensions ...extension.Extension) error
DecodeWithTag is similar to Decode but allows an extra tag parameter instead of the default Tag
func Encode ¶
Encode will convert the object provided to a JSON string. you can add extensions to use instead of the default extensions by including them as parameters to this function.
func EncodeWithTag ¶ added in v1.0.4
func EncodeWithTag(tag string, goObject interface{}, pretty bool, extensions ...extension.Extension) (string, error)
EncodeWithTag is similar to Encode but allows an extra tag parameter instead of the default Tag
func SetTagName ¶ added in v1.0.4
func SetTagName(newTagName string)
SetTagName allows you to use a custom tag name when encoding or decoding. by default the tag 'json' is used
Types ¶
This section is empty.