fastjson

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal serializes v to JSON using the fast encoder. This is a drop-in replacement for encoding/json.Marshal but is 2-3x faster.

func MarshalIndent

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

MarshalIndent is like Marshal but applies indentation for pretty-printing.

func NewDecoder

func NewDecoder(r io.Reader) *gojson.Decoder

NewDecoder creates a new JSON decoder that reads from r. This is a drop-in replacement for encoding/json.NewDecoder.

func NewEncoder

func NewEncoder(w io.Writer) *gojson.Encoder

NewEncoder creates a new JSON encoder that writes to w. This is a drop-in replacement for encoding/json.NewEncoder but uses the faster goccy/go-json implementation.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal deserializes JSON data into v using the fast decoder. This is a drop-in replacement for encoding/json.Unmarshal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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