json

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonAdapt

func JsonAdapt(input, target interface{}) error

func Marshal

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

Marshal delegates to jsoniterStd It is only here so this package can be a drop-in for common encoding/json uses

func NewDecoder

func NewDecoder(reader io.Reader) *jsoniter.Decoder

NewDecoder delegates to jsoniterStd

func NewEncoder

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

NewEncoder delegates to jsoniterStd

func Unmarshal

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

Unmarshal delegates to jsoniterStd

func UnmarshalV2

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

Unmarshal unmarshals the given data If v is a *map[string]interface{}, numbers are converted to int64 or float64

func Valid

func Valid(data []byte) bool

Valid delegates to jsoniterStd

Types

type InvalidUnmarshalError

type InvalidUnmarshalError = json.InvalidUnmarshalError

type JsoniterSerializer

type JsoniterSerializer struct{}

func (*JsoniterSerializer) Deserialize

func (*JsoniterSerializer) Deserialize(data []byte, v interface{}) error

func (*JsoniterSerializer) Serialize

func (*JsoniterSerializer) Serialize(v interface{}) ([]byte, error)

type MarshalerError

type MarshalerError = json.MarshalerError

type Number

type Number = json.Number

type RawMessage

type RawMessage = json.RawMessage

type SyntaxError

type SyntaxError = json.SyntaxError

type T

type T struct {
	A                    string            `protobuf:"bytes,1,opt,name=A,proto3" json:"A,omitempty"`
	B                    int64             `protobuf:"varint,2,opt,name=B,proto3" json:"B,omitempty"`
	C                    map[string]string `` /* 143-byte string literal not displayed */
	D                    []int64           `protobuf:"varint,4,rep,packed,name=D,proto3" json:"D,omitempty"`
	Extra                *TE               `protobuf:"bytes,5,opt,name=Extra,proto3" json:"Extra,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*T) Descriptor

func (*T) Descriptor() ([]byte, []int)

func (*T) GetA

func (m *T) GetA() string

func (*T) GetB

func (m *T) GetB() int64

func (*T) GetC

func (m *T) GetC() map[string]string

func (*T) GetD

func (m *T) GetD() []int64

func (*T) GetExtra

func (m *T) GetExtra() *TE

func (*T) ProtoMessage

func (*T) ProtoMessage()

func (*T) Reset

func (m *T) Reset()

func (*T) String

func (m *T) String() string

func (*T) XXX_DiscardUnknown

func (m *T) XXX_DiscardUnknown()

func (*T) XXX_Marshal

func (m *T) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*T) XXX_Merge

func (m *T) XXX_Merge(src proto.Message)

func (*T) XXX_Size

func (m *T) XXX_Size() int

func (*T) XXX_Unmarshal

func (m *T) XXX_Unmarshal(b []byte) error

type TE

type TE struct {
	A                    string            `protobuf:"bytes,1,opt,name=A,proto3" json:"A,omitempty"`
	B                    int64             `protobuf:"varint,2,opt,name=B,proto3" json:"B,omitempty"`
	C                    map[string]string `` /* 143-byte string literal not displayed */
	D                    []int64           `protobuf:"varint,4,rep,packed,name=D,proto3" json:"D,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*TE) Descriptor

func (*TE) Descriptor() ([]byte, []int)

func (*TE) GetA

func (m *TE) GetA() string

func (*TE) GetB

func (m *TE) GetB() int64

func (*TE) GetC

func (m *TE) GetC() map[string]string

func (*TE) GetD

func (m *TE) GetD() []int64

func (*TE) ProtoMessage

func (*TE) ProtoMessage()

func (*TE) Reset

func (m *TE) Reset()

func (*TE) String

func (m *TE) String() string

func (*TE) XXX_DiscardUnknown

func (m *TE) XXX_DiscardUnknown()

func (*TE) XXX_Marshal

func (m *TE) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TE) XXX_Merge

func (m *TE) XXX_Merge(src proto.Message)

func (*TE) XXX_Size

func (m *TE) XXX_Size() int

func (*TE) XXX_Unmarshal

func (m *TE) XXX_Unmarshal(b []byte) error

type UnmarshalTypeError

type UnmarshalTypeError = json.UnmarshalTypeError

type UnsupportedTypeError

type UnsupportedTypeError = json.UnsupportedTypeError

Jump to

Keyboard shortcuts

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