Documentation
¶
Index ¶
- Variables
- func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error
- func Marshal(v any) ([]byte, error)
- func MarshalIndent(v any, prefix, indent string) ([]byte, error)
- func MarshalKeepOptionalEmpty(v any) ([]byte, error)
- func Unmarshal(data []byte, v any) error
- func UnmarshalHandleDoubleEncode(bs []byte, v any) error
- func Valid(data []byte) bool
- type Decoder
- type Encoder
- type Interface
- type RawMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultJSONHandler = getDefaultJSONHandler()
Functions ¶
func Indent ¶
Indent appends to dst an indented form of the JSON-encoded src.
func MarshalIndent ¶
MarshalIndent copied from encoding/json
func UnmarshalHandleDoubleEncode ¶
UnmarshalHandleDoubleEncode - due to a bug in xorm (see https://gitea.com/xorm/xorm/pulls/1957) - it's possible that a Blob may be double encoded or gain an unwanted prefix of 0xff 0xfe.
Types ¶
type Decoder ¶
Decoder represents a decoder for json
func NewDecoder ¶
NewDecoder creates a decoder to read objects from reader
type Encoder ¶
Encoder represents an encoder for json
type Interface ¶
type Interface interface {
Marshal(v any) ([]byte, error)
Unmarshal(data []byte, v any) error
NewEncoder(writer io.Writer) Encoder
NewDecoder(reader io.Reader) Decoder
Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error
}
Interface represents an interface to handle json data
type RawMessage ¶
type RawMessage = json.RawMessage
RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding.
Source Files
¶
- json.go
- jsongoccy.go
- jsonlegacy.go
- jsonv1.go
Click to show internal directories.
Click to hide internal directories.