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 Value
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultJSONHandler = getDefaultJSONHandler()
Functions ¶
func MarshalIndent ¶
MarshalIndent copied from encoding/json
func MarshalKeepOptionalEmpty ¶ added in v1.26.0
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
func NewDecoderCaseInsensitive ¶ added in v1.26.0
type Encoder ¶
Encoder represents an encoder for json
func NewEncoder ¶
NewEncoder creates an encoder to write objects to writer
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 Value ¶ added in v1.26.0
type Value = json.RawMessage
Click to show internal directories.
Click to hide internal directories.