bunjson

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: BSD-2-Clause Imports: 2 Imported by: 6 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

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

func SetProvider

func SetProvider(p Provider)

func Unmarshal

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

Types

type Decoder

type Decoder interface {
	Decode(v any) error
	UseNumber()
}

func NewDecoder

func NewDecoder(r io.Reader) Decoder

type Encoder

type Encoder interface {
	Encode(v any) error
}

func NewEncoder

func NewEncoder(w io.Writer) Encoder

type Provider

type Provider interface {
	Marshal(v any) ([]byte, error)
	Unmarshal(data []byte, v any) error
	NewEncoder(w io.Writer) Encoder
	NewDecoder(r io.Reader) Decoder
}

type StdProvider

type StdProvider struct{}

StdProvider implements the JSON Provider interface using the standard encoding/json package.

func (StdProvider) Marshal

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

func (StdProvider) NewDecoder

func (StdProvider) NewDecoder(r io.Reader) Decoder

func (StdProvider) NewEncoder

func (StdProvider) NewEncoder(w io.Writer) Encoder

func (StdProvider) Unmarshal

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

Jump to

Keyboard shortcuts

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