Help us shape the future of Go! Take the 2026 Go Developer Survey

badjson

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: GPL-2.0 Imports: 11 Imported by: 52

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(ctx context.Context, content []byte) (any, error)

func MarshallObjects added in v0.5.0

func MarshallObjects(objects ...any) ([]byte, error)

func MarshallObjectsContext added in v0.6.0

func MarshallObjectsContext(ctx context.Context, objects ...any) ([]byte, error)

func Merge

func Merge[T any](ctx context.Context, source T, destination T, disableAppend bool) (T, error)

func MergeFrom

func MergeFrom[T any](ctx context.Context, rawSource json.RawMessage, rawDestination json.RawMessage, disableAppend bool) (T, error)

func MergeFromDestination

func MergeFromDestination[T any](ctx context.Context, source T, rawDestination json.RawMessage, disableAppend bool) (T, error)

func MergeFromSource

func MergeFromSource[T any](ctx context.Context, rawSource json.RawMessage, destination T, disableAppend bool) (T, error)

func MergeJSON

func MergeJSON(ctx context.Context, rawSource json.RawMessage, rawDestination json.RawMessage, disableAppend bool) (json.RawMessage, error)

func Omitempty

func Omitempty[T any](ctx context.Context, value T) (T, error)

func UnmarshallExcluded added in v0.5.0

func UnmarshallExcluded(inputContent []byte, parentObject any, object any) error

func UnmarshallExcludedContext added in v0.6.0

func UnmarshallExcludedContext(ctx context.Context, inputContent []byte, parentObject any, object any) error

func UnmarshallExcludedContextMulti added in v0.7.0

func UnmarshallExcludedContextMulti(ctx context.Context, inputContent []byte, parentObject any, object any) error

func UnmarshallExcludedMulti added in v0.7.0

func UnmarshallExcludedMulti(inputContent []byte, parentObject any, object any) 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) MarshalJSONContext added in v0.6.0

func (m *JSONObject) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*JSONObject) UnmarshalJSON

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

func (*JSONObject) UnmarshalJSONContext added in v0.6.0

func (m *JSONObject) UnmarshalJSONContext(ctx context.Context, 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]) MarshalJSONContext added in v0.6.0

func (m TypedMap[K, V]) MarshalJSONContext(ctx context.Context) ([]byte, error)

func (*TypedMap[K, V]) UnmarshalJSON

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

func (*TypedMap[K, V]) UnmarshalJSONContext added in v0.6.0

func (m *TypedMap[K, V]) UnmarshalJSONContext(ctx context.Context, content []byte) error

Jump to

Keyboard shortcuts

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