jsonb

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeTime

func DecodeTime(str string) (t time.Time, err error)

DecodeTime :

func Marshal

func Marshal(src interface{}) (b []byte, err error)

Marshal :

func Unmarshal

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

Unmarshal :

func UnmarshalValue

func UnmarshalValue(data []byte, v reflect.Value) error

UnmarshalValue :

Types

type DefaultDecoder

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

DefaultDecoder :

func (*DefaultDecoder) DecodeArray

func (dec *DefaultDecoder) DecodeArray(r *Reader, v reflect.Value) error

DecodeArray :

func (DefaultDecoder) DecodeBool

func (dec DefaultDecoder) DecodeBool(r *Reader, v reflect.Value) error

DecodeBool :

func (DefaultDecoder) DecodeByte

func (dec DefaultDecoder) DecodeByte(r *Reader, v reflect.Value) error

DecodeByte :

func (DefaultDecoder) DecodeCurrency

func (dec DefaultDecoder) DecodeCurrency(r *Reader, v reflect.Value) error

DecodeCurrency :

func (DefaultDecoder) DecodeFloat

func (dec DefaultDecoder) DecodeFloat(r *Reader, v reflect.Value) error

DecodeFloat :

func (DefaultDecoder) DecodeInt

func (dec DefaultDecoder) DecodeInt(quote bool) ValueDecoder

DecodeInt :

func (DefaultDecoder) DecodeInterface

func (dec DefaultDecoder) DecodeInterface(r *Reader, v reflect.Value) error

DecodeInterface :

func (DefaultDecoder) DecodeJSONNumber

func (dec DefaultDecoder) DecodeJSONNumber(r *Reader, v reflect.Value) error

DecodeJSONNumber :

func (DefaultDecoder) DecodeJSONRaw

func (dec DefaultDecoder) DecodeJSONRaw(r *Reader, v reflect.Value) error

DecodeJSONRaw :

func (DefaultDecoder) DecodeLanguage

func (dec DefaultDecoder) DecodeLanguage(r *Reader, v reflect.Value) error

DecodeLanguage :

func (*DefaultDecoder) DecodeMap

func (dec *DefaultDecoder) DecodeMap(r *Reader, v reflect.Value) error

DecodeMap :

func (*DefaultDecoder) DecodePtr

func (dec *DefaultDecoder) DecodePtr(r *Reader, v reflect.Value) error

DecodePtr :

func (*DefaultDecoder) DecodeSlice

func (dec *DefaultDecoder) DecodeSlice(r *Reader, v reflect.Value) error

DecodeSlice :

func (DefaultDecoder) DecodeString

func (dec DefaultDecoder) DecodeString(r *Reader, v reflect.Value) error

DecodeString :

func (*DefaultDecoder) DecodeStruct

func (dec *DefaultDecoder) DecodeStruct(r *Reader, v reflect.Value) error

DecodeStruct :

func (DefaultDecoder) DecodeTime

func (dec DefaultDecoder) DecodeTime(r *Reader, v reflect.Value) error

DecodeTime :

func (DefaultDecoder) DecodeUint

func (dec DefaultDecoder) DecodeUint(quote bool) ValueDecoder

DecodeUint :

type DefaultEncoder

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

DefaultEncoder :

func (*DefaultEncoder) EncodeArray

func (enc *DefaultEncoder) EncodeArray(w *Writer, v reflect.Value) error

EncodeArray :

func (DefaultEncoder) EncodeBool

func (enc DefaultEncoder) EncodeBool(w *Writer, v reflect.Value) error

EncodeBool :

func (DefaultEncoder) EncodeByte

func (enc DefaultEncoder) EncodeByte(w *Writer, v reflect.Value) error

EncodeByte :

func (DefaultEncoder) EncodeFloat

func (enc DefaultEncoder) EncodeFloat(w *Writer, v reflect.Value) error

EncodeFloat :

func (DefaultEncoder) EncodeInt

func (enc DefaultEncoder) EncodeInt(w *Writer, v reflect.Value) error

EncodeInt :

func (*DefaultEncoder) EncodeInterface

func (enc *DefaultEncoder) EncodeInterface(w *Writer, v reflect.Value) error

EncodeInterface :

func (DefaultEncoder) EncodeJSONRaw

func (enc DefaultEncoder) EncodeJSONRaw(w *Writer, v reflect.Value) error

EncodeJSONRaw :

func (*DefaultEncoder) EncodeMap

func (enc *DefaultEncoder) EncodeMap(w *Writer, v reflect.Value) error

EncodeMap :

func (*DefaultEncoder) EncodePtr

func (enc *DefaultEncoder) EncodePtr(w *Writer, v reflect.Value) error

EncodePtr :

func (DefaultEncoder) EncodeString

func (enc DefaultEncoder) EncodeString(w *Writer, v reflect.Value) error

EncodeString :

func (DefaultEncoder) EncodeStringer

func (enc DefaultEncoder) EncodeStringer(w *Writer, v reflect.Value) error

EncodeStringer :

func (*DefaultEncoder) EncodeStruct

func (enc *DefaultEncoder) EncodeStruct(w *Writer, v reflect.Value) error

EncodeStruct :

func (DefaultEncoder) EncodeTime

func (enc DefaultEncoder) EncodeTime(w *Writer, v reflect.Value) error

EncodeTime :

func (DefaultEncoder) EncodeUint

func (enc DefaultEncoder) EncodeUint(w *Writer, v reflect.Value) error

EncodeUint :

type ErrInvalidJSON

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

ErrInvalidJSON :

func (ErrInvalidJSON) Error

func (e ErrInvalidJSON) Error() string

type ErrNoDecoder

type ErrNoDecoder struct {
	Type reflect.Type
}

ErrNoDecoder :

func (ErrNoDecoder) Error

func (err ErrNoDecoder) Error() (msg string)

type ErrNoEncoder

type ErrNoEncoder struct {
	Type reflect.Type
}

ErrNoEncoder :

func (ErrNoEncoder) Error

func (err ErrNoEncoder) Error() (msg string)

type Marshaler

type Marshaler interface {
	MarshalJSONB() ([]byte, error)
}

Marshaler :

type Number

type Number = json.Number

Number :

type Reader

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

Reader :

func NewReader

func NewReader(b []byte) *Reader

NewReader :

func (*Reader) Bytes

func (r *Reader) Bytes() []byte

Bytes :

func (*Reader) IsNull

func (r *Reader) IsNull() bool

IsNull :

func (*Reader) ReadArray

func (r *Reader) ReadArray(cb func(r *Reader) error) error

ReadArray :

func (*Reader) ReadBoolean

func (r *Reader) ReadBoolean() (bool, error)

ReadBoolean :

func (*Reader) ReadBytes

func (r *Reader) ReadBytes() ([]byte, error)

ReadBytes :

func (*Reader) ReadFlattenObject

func (r *Reader) ReadFlattenObject(cb func(*Reader, string) error) error

ReadFlattenObject :

func (*Reader) ReadNull

func (r *Reader) ReadNull() error

ReadNull :

func (*Reader) ReadNumber

func (r *Reader) ReadNumber() (Number, error)

ReadNumber :

func (*Reader) ReadObject

func (r *Reader) ReadObject(cb func(*Reader, string) error) error

ReadObject :

func (*Reader) ReadRawString

func (r *Reader) ReadRawString() (string, error)

ReadRawString :

func (*Reader) ReadString

func (r *Reader) ReadString() (string, error)

ReadString :

func (*Reader) ReadValue

func (r *Reader) ReadValue() (interface{}, error)

ReadValue :

type Registry

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

Registry :

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new empty Registry.

func (*Registry) LookupDecoder

func (r *Registry) LookupDecoder(t reflect.Type) (ValueDecoder, error)

LookupDecoder :

func (*Registry) LookupEncoder

func (r *Registry) LookupEncoder(v reflect.Value) (ValueEncoder, error)

LookupEncoder :

func (*Registry) SetKindCoder

func (r *Registry) SetKindCoder(k reflect.Kind, enc ValueEncoder, dec ValueDecoder)

SetKindCoder :

func (*Registry) SetTypeCoder

func (r *Registry) SetTypeCoder(t reflect.Type, enc ValueEncoder, dec ValueDecoder)

SetTypeCoder :

type Unmarshaler

type Unmarshaler interface {
	UnmarshalJSONB([]byte) error
}

Unmarshaler :

type ValueDecoder

type ValueDecoder func(*Reader, reflect.Value) error

ValueDecoder :

type ValueEncoder

type ValueEncoder func(*Writer, reflect.Value) error

ValueEncoder :

type Writer

type Writer struct {
	bytes.Buffer
}

Writer :

func NewWriter

func NewWriter() *Writer

NewWriter :

Jump to

Keyboard shortcuts

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