Documentation ¶
Index ¶
- Variables
- func Compact(src []byte) ([]byte, error)
- func CompactString(src string) (string, error)
- func Indent(src []byte) ([]byte, error)
- func IndentString(src string) (string, error)
- func Marshal(v any) ([]byte, error)
- func MarshalIndent(v any) ([]byte, error)
- func MarshalIndentString(v any) (string, error)
- func MarshalString(v any) (string, error)
- func MustCompact(src []byte) []byte
- func MustCompactString(src string) string
- func MustIndent(src []byte) []byte
- func MustIndentString(src string) string
- func MustMarshal(v any) []byte
- func MustMarshalIndent(v any) []byte
- func MustMarshalIndentString(v any) string
- func MustMarshalString(v any) string
- func MustUnmarshal(bs []byte, v any)
- func MustUnmarshalString(s string, v any)
- func MustUnmarshalTo[T any](a any) T
- func Unmarshal(bs []byte, v any) error
- func UnmarshalString(s string, v any) error
- func UnmarshalTo[T any](a any) (T, error)
- type MarshalOptions
- func (o MarshalOptions) Compact(src []byte) ([]byte, error)
- func (o MarshalOptions) CompactString(src string) (string, error)
- func (o MarshalOptions) Indent(src []byte) ([]byte, error)
- func (o MarshalOptions) IndentString(src string) (string, error)
- func (o MarshalOptions) Marshal(v any) ([]byte, error)
- func (o MarshalOptions) MarshalIndent(v any) ([]byte, error)
- func (o MarshalOptions) MarshalIndentString(v any) (string, error)
- func (o MarshalOptions) MarshalString(v any) (string, error)
- func (o MarshalOptions) MustCompact(src []byte) []byte
- func (o MarshalOptions) MustCompactString(src string) string
- func (o MarshalOptions) MustIndent(src []byte) []byte
- func (o MarshalOptions) MustIndentString(src string) string
- func (o MarshalOptions) MustMarshal(v any) []byte
- func (o MarshalOptions) MustMarshalIndent(v any) []byte
- func (o MarshalOptions) MustMarshalIndentString(v any) string
- func (o MarshalOptions) MustMarshalString(v any) string
- type Options
- type UnmarshalOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var G = Options{ MarshalOptions: MarshalOptions{ PrefixStr: "", IndentStr: " ", }, UnmarshalOptions: UnmarshalOptions{}, }
Functions ¶
func CompactString ¶ added in v2.0.15
func IndentString ¶ added in v2.0.15
func MarshalIndent ¶
func MarshalIndentString ¶
func MarshalString ¶
func MustCompact ¶ added in v2.0.15
func MustCompactString ¶ added in v2.0.15
func MustIndent ¶ added in v2.0.15
func MustIndentString ¶ added in v2.0.15
func MustMarshal ¶
func MustMarshalIndent ¶
func MustMarshalIndentString ¶
func MustMarshalString ¶
func MustUnmarshal ¶
func MustUnmarshalString ¶
func MustUnmarshalTo ¶
func UnmarshalString ¶
func UnmarshalTo ¶
Types ¶
type MarshalOptions ¶
type MarshalOptions struct { DisableHTMLEscape bool DisableNormalizeUTF8 bool PrefixStr string IndentStr string }
func (MarshalOptions) Compact ¶ added in v2.0.15
func (o MarshalOptions) Compact(src []byte) ([]byte, error)
func (MarshalOptions) CompactString ¶ added in v2.0.15
func (o MarshalOptions) CompactString(src string) (string, error)
func (MarshalOptions) IndentString ¶ added in v2.0.15
func (o MarshalOptions) IndentString(src string) (string, error)
func (MarshalOptions) MarshalIndent ¶
func (o MarshalOptions) MarshalIndent(v any) ([]byte, error)
func (MarshalOptions) MarshalIndentString ¶
func (o MarshalOptions) MarshalIndentString(v any) (string, error)
func (MarshalOptions) MarshalString ¶
func (o MarshalOptions) MarshalString(v any) (string, error)
func (MarshalOptions) MustCompact ¶ added in v2.0.15
func (o MarshalOptions) MustCompact(src []byte) []byte
func (MarshalOptions) MustCompactString ¶ added in v2.0.15
func (o MarshalOptions) MustCompactString(src string) string
func (MarshalOptions) MustIndent ¶ added in v2.0.15
func (o MarshalOptions) MustIndent(src []byte) []byte
func (MarshalOptions) MustIndentString ¶ added in v2.0.15
func (o MarshalOptions) MustIndentString(src string) string
func (MarshalOptions) MustMarshal ¶
func (o MarshalOptions) MustMarshal(v any) []byte
func (MarshalOptions) MustMarshalIndent ¶
func (o MarshalOptions) MustMarshalIndent(v any) []byte
func (MarshalOptions) MustMarshalIndentString ¶
func (o MarshalOptions) MustMarshalIndentString(v any) string
func (MarshalOptions) MustMarshalString ¶
func (o MarshalOptions) MustMarshalString(v any) string
type Options ¶
type Options struct { MarshalOptions UnmarshalOptions }
type UnmarshalOptions ¶
type UnmarshalOptions struct { }
func (UnmarshalOptions) MustUnmarshal ¶
func (o UnmarshalOptions) MustUnmarshal(bs []byte, v any)
func (UnmarshalOptions) MustUnmarshalString ¶
func (o UnmarshalOptions) MustUnmarshalString(s string, v any)
func (UnmarshalOptions) UnmarshalString ¶
func (o UnmarshalOptions) UnmarshalString(s string, v any) error
Click to show internal directories.
Click to hide internal directories.