Documentation
¶
Index ¶
- func Beautify[T ~string | ~[]byte](rawJSON T) (T, error)
- func Compact(dst *bytes.Buffer, src []byte) error
- func Copy(dst any, src any) error
- func Equal(a, b any) bool
- func HTMLEscape(dst *bytes.Buffer, src []byte)
- func Indent(dst *bytes.Buffer, src []byte, prefix string, indent string) error
- func Marshal(v any) ([]byte, error)
- func MarshalIndent(v any, prefix, indent string) ([]byte, error)
- func MarshalX[T ~string | ~[]byte](v any) (T, error)
- func MustBeautify[T ~string | ~[]byte](rawJSON T) T
- func MustMarshal(v any) []byte
- func MustMarshalX[T ~string | ~[]byte](v any) T
- func MustToMap(v any) map[string]any
- func NewDecoder(r io.Reader) *json.Decoder
- func NewEncoder(w io.Writer) *json.Encoder
- func Patch(patch []byte, dest any) error
- func ToMap(v any) (map[string]any, error)
- func Unmarshal(data []byte, v any) error
- func Valid(data []byte) bool
- type Decoder
- type Delim
- type Encoder
- type InvalidUnmarshalError
- type Marshaler
- type MarshalerError
- type Number
- type RawMessage
- type SyntaxError
- type Token
- type UnmarshalTypeError
- type Unmarshaler
- type UnsupportedTypeError
- type UnsupportedValueError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTMLEscape ¶ added in v3.2.0
func Marshal ¶
Marshal converts a value to JSON bytes, with special handling for proto.Message types. Supports marshaling from proto.Message through multiple levels of pointers.
func MarshalIndent ¶ added in v3.2.0
func MustBeautify ¶
func MustMarshal ¶
func MustMarshalX ¶
Types ¶
type InvalidUnmarshalError ¶ added in v3.2.0
type InvalidUnmarshalError = json.InvalidUnmarshalError
type MarshalerError ¶ added in v3.2.0
type MarshalerError = json.MarshalerError
type RawMessage ¶ added in v3.2.0
type RawMessage = json.RawMessage
type SyntaxError ¶ added in v3.2.0
type SyntaxError = json.SyntaxError
type UnmarshalTypeError ¶ added in v3.2.0
type UnmarshalTypeError = json.UnmarshalTypeError
type Unmarshaler ¶ added in v3.2.0
type Unmarshaler = json.Unmarshaler
type UnsupportedTypeError ¶ added in v3.2.0
type UnsupportedTypeError = json.UnsupportedTypeError
type UnsupportedValueError ¶ added in v3.2.0
type UnsupportedValueError = json.UnsupportedValueError
Click to show internal directories.
Click to hide internal directories.