badjson

package
v0.5.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-2.0 Imports: 9 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(content []byte) (any, error)

func Merge

func Merge[T any](source T, destination T) (T, error)

func MergeFrom

func MergeFrom[T any](rawSource json.RawMessage, rawDestination json.RawMessage) (T, error)

func MergeFromDestination

func MergeFromDestination[T any](source T, rawDestination json.RawMessage) (T, error)

func MergeFromSource

func MergeFromSource[T any](rawSource json.RawMessage, destination T) (T, error)

func MergeJSON

func MergeJSON(rawSource json.RawMessage, rawDestination json.RawMessage) (json.RawMessage, error)

func Omitempty

func Omitempty[T any](value T) (T, error)

Types

type JSONArray

type JSONArray []any

func (JSONArray) IsEmpty added in v0.4.0

func (a JSONArray) IsEmpty() bool

func (JSONArray) MarshalJSON

func (a JSONArray) MarshalJSON() ([]byte, error)

func (*JSONArray) UnmarshalJSON

func (a *JSONArray) UnmarshalJSON(content []byte) error

type JSONObject

type JSONObject struct {
	linkedhashmap.Map[string, any]
}

func (*JSONObject) IsEmpty added in v0.4.0

func (m *JSONObject) IsEmpty() bool

func (*JSONObject) MarshalJSON

func (m *JSONObject) MarshalJSON() ([]byte, error)

func (*JSONObject) UnmarshalJSON

func (m *JSONObject) UnmarshalJSON(content []byte) error

type TypedMap

type TypedMap[K comparable, V any] struct {
	linkedhashmap.Map[K, V]
}

func (TypedMap[K, V]) MarshalJSON

func (m TypedMap[K, V]) MarshalJSON() ([]byte, error)

func (*TypedMap[K, V]) UnmarshalJSON

func (m *TypedMap[K, V]) UnmarshalJSON(content []byte) error

Jump to

Keyboard shortcuts

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