jsonx

package
v0.77.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2020 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeGeneric

func DecodeGeneric(data []byte) (interface{}, error)

DecodeGeneric decodes the given JSON as a generic map or slice

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal marshals the given object to JSON

func MarshalMerged

func MarshalMerged(v1 interface{}, v2 interface{}) ([]byte, error)

MarshalMerged marshals the properties of two objects as one object

func MarshalPretty

func MarshalPretty(v interface{}) ([]byte, error)

MarshalPretty marshals the given object to pretty JSON

func Unmarshal added in v0.74.0

func Unmarshal(data json.RawMessage, v interface{}) error

Unmarshal is just a shortcut for json.Unmarshal so all calls can be made via the jsonx package

func UnmarshalArray

func UnmarshalArray(data json.RawMessage) ([]json.RawMessage, error)

UnmarshalArray unmarshals an array of objects from the given JSON

func UnmarshalWithLimit

func UnmarshalWithLimit(reader io.ReadCloser, s interface{}, limit int64) error

UnmarshalWithLimit unmarsmals a struct with a limit on how many bytes can be read from the given reader

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL