Documentation ¶
Index ¶
- func DecodeGeneric(data []byte) (any, error)
- func Marshal(v any) ([]byte, error)
- func MarshalMerged(v1 any, v2 any) ([]byte, error)
- func MarshalPretty(v any) ([]byte, error)
- func MustMarshal(v any) []byte
- func MustUnmarshal(data []byte, v any)
- func Unmarshal(data []byte, v any) error
- func UnmarshalArray(data []byte) ([]json.RawMessage, error)
- func UnmarshalWithLimit(reader io.ReadCloser, s any, limit int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeGeneric ¶
DecodeGeneric decodes the given JSON as a generic map or slice
func MarshalMerged ¶
MarshalMerged marshals the properties of two objects as one object
func MarshalPretty ¶
MarshalPretty marshals the given object to pretty JSON
func MustMarshal ¶ added in v1.11.0
MustMarshal marshals the given object to JSON, panicking on an error
func MustUnmarshal ¶ added in v1.11.0
MustUnmarshal unmarshals the given JSON, panicking on an error
func Unmarshal ¶
Unmarshal is just a shortcut for json.Unmarshal so all calls can be made via the jsonx package
func UnmarshalArray ¶
func UnmarshalArray(data []byte) ([]json.RawMessage, error)
UnmarshalArray unmarshals an array of objects from the given JSON
func UnmarshalWithLimit ¶
func UnmarshalWithLimit(reader io.ReadCloser, s any, 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.
Click to show internal directories.
Click to hide internal directories.