bunjson

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: BSD-2-Clause Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

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

func SetProvider

func SetProvider(p Provider)

func Unmarshal

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

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) Decoder

type Encoder

type Encoder interface {
	Encode(v interface{}) error
}

func NewEncoder

func NewEncoder(w io.Writer) Encoder

type Provider

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

type StdProvider

type StdProvider struct{}

func (StdProvider) Marshal

func (StdProvider) Marshal(v interface{}) ([]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 interface{}) error

Jump to

Keyboard shortcuts

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