jsonenc

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 8 Imported by: 9

Documentation

Overview

Package jsonenc support encoding and decoding by json.

Index

Constants

This section is empty.

Variables

View Source
var JSONEncoderHint = hint.MustNewHint("json-encoder-v2.0.0")

Functions

This section is empty.

Types

type Decodable

type Decodable interface {
	DecodeJSON([]byte, *Encoder) error
}

type Encoder

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

func NewEncoder

func NewEncoder() *Encoder

func (*Encoder) Add

func (enc *Encoder) Add(d encoder.DecodeDetail) error

func (*Encoder) AddHinter

func (enc *Encoder) AddHinter(hr hint.Hinter) error

func (*Encoder) Decode

func (enc *Encoder) Decode(b []byte) (interface{}, error)

func (*Encoder) DecodeSlice

func (enc *Encoder) DecodeSlice(b []byte) ([]interface{}, error)

func (*Encoder) DecodeWithFixedHintType

func (enc *Encoder) DecodeWithFixedHintType(s string, size int) (interface{}, error)

func (*Encoder) DecodeWithHint

func (enc *Encoder) DecodeWithHint(b []byte, ht hint.Hint) (interface{}, error)

func (*Encoder) DecodeWithHintType

func (enc *Encoder) DecodeWithHintType(b []byte, t hint.Type) (interface{}, error)

func (*Encoder) Hint

func (*Encoder) Hint() hint.Hint

func (*Encoder) Marshal

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

func (*Encoder) SetPool

func (enc *Encoder) SetPool(pool util.ObjectPool) *Encoder

func (*Encoder) StreamDecoder

func (*Encoder) StreamDecoder(r io.Reader) util.StreamDecoder

func (*Encoder) StreamEncoder

func (*Encoder) StreamEncoder(w io.Writer) util.StreamEncoder

func (*Encoder) Unmarshal

func (*Encoder) Unmarshal(b []byte, v interface{}) error

Jump to

Keyboard shortcuts

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