json

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: Apache-2.0 Imports: 1 Imported by: 1

README

Go Reference Go Report Go Version License json Version Discord

json

json provides configurable interfaces for JSON encoding/decoding and a json merge function.

Getting Started

Installing
go get github.com/disgoorg/json/v2

Documentation

Documentation is wip and can be found under

  • Go Reference

Troubleshooting

For help feel free to open an issue or reach out on Discord

Contributing

Contributions are welcomed but for bigger changes we recommend first reaching out via Discord or create an issue to discuss your problems, intentions and ideas.

License

Distributed under the License. See LICENSE for more information.

Documentation

Overview

Package json provides configurable interfaces for JSON encoding and decoding.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Marshal marshals the given value into a JSON string.
	Marshal = json.Marshal

	// Unmarshal unmarshals the given JSON string into v.
	Unmarshal = json.Unmarshal

	// Merge merges two JSON objects into one.
	Merge = SimpleMerge

	// MarshalIndent marshals the given value into a JSON string with indentation.
	MarshalIndent = json.MarshalIndent

	// Indent is the indentation used in MarshalIndent.
	Indent = json.Indent

	// NewEncoder returns a new JSON encoder that writes to w.
	NewEncoder = json.NewEncoder

	// NewDecoder returns a new JSON decoder that reads from r.
	NewDecoder = json.NewDecoder
)

Functions

func SimpleMerge

func SimpleMerge(data1 []byte, data2 []byte) ([]byte, error)

SimpleMerge merges two JSON objects into one. If a key exists in both objects, the value from the second object is used.

Types

type Marshaler

type Marshaler = json.Marshaler

Marshaler is the interface implemented by types that can marshal JSON.

type Number

type Number = json.Number

Number represents a JSON number literal.

type RawMessage

type RawMessage = json.RawMessage

RawMessage is a raw encoded JSON value.

type Unmarshaler

type Unmarshaler = json.Unmarshaler

Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves.

Jump to

Keyboard shortcuts

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