jsonutil

package
v0.0.6-beta Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v any) ([]byte, error)

func MarshalIndent

func MarshalIndent(v any, prefix, indent string) ([]byte, error)

func Unmarshal

func Unmarshal(data []byte, v any) error

Types

type Decoder

type Decoder = decoder.StreamDecoder

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder wraps sonic's streaming encoder with SetIndent support.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(v any) error

func (*Encoder) SetIndent

func (e *Encoder) SetIndent(prefix, indent string)

type RawMessage

type RawMessage = []byte

Jump to

Keyboard shortcuts

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