json

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 1 Imported by: 1

README

GO JSON Package

go build -tag <tags>

tags:
    jsoniter: github.com/json-iterator/go
    go_json: github.com/goccy/go-json
    default: encoding/json

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Marshal       = json.Marshal
	MarshalIndent = json.MarshalIndent
	Unmarshal     = json.Unmarshal
	NewDecoder    = json.NewDecoder
	NewEncoder    = json.NewEncoder
	HTMLEscape    = json.HTMLEscape
)

Functions

This section is empty.

Types

type Decoder

type Decoder = json.Decoder

type Encoder

type Encoder = json.Encoder

type Marshaler

type Marshaler interface {
	MarshalJSON() ([]byte, error)
}

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

type RawMessage

type RawMessage = json.RawMessage

type Unmarshaler

type Unmarshaler interface {
	UnmarshalJSON([]byte) error
}

Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. The input can be assumed to be a valid encoding of a JSON value. UnmarshalJSON must copy the JSON data if it wishes to retain the data after returning.

By convention, to approximate the behavior of Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op.

Jump to

Keyboard shortcuts

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