Versions in this module Expand all Collapse all v1 v1.1.5 Aug 6, 2018 Changes in this version + var ConfigCompatibleWithStandardLibrary = ...() + var ConfigDefault = ...() + var ConfigFastest = ...() + func CastJsonNumber(val interface{}) (string, bool) + func Marshal(v interface{}) ([]byte, error) + func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) + func MarshalToString(v interface{}) (string, error) + func RegisterExtension(extension Extension) + func RegisterFieldDecoder(typ string, field string, decoder ValDecoder) + func RegisterFieldDecoderFunc(typ string, field string, fun DecoderFunc) + func RegisterFieldEncoder(typ string, field string, encoder ValEncoder) + func RegisterFieldEncoderFunc(typ string, field string, fun EncoderFunc, ...) + func RegisterTypeDecoder(typ string, decoder ValDecoder) + func RegisterTypeDecoderFunc(typ string, fun DecoderFunc) + func RegisterTypeEncoder(typ string, encoder ValEncoder) + func RegisterTypeEncoderFunc(typ string, fun EncoderFunc, isEmptyFunc func(unsafe.Pointer) bool) + func Unmarshal(data []byte, v interface{}) error + func UnmarshalFromString(str string, v interface{}) error + func Valid(data []byte) bool + type API interface + DecoderOf func(typ reflect2.Type) ValDecoder + EncoderOf func(typ reflect2.Type) ValEncoder + Get func(data []byte, path ...interface{}) Any + Marshal func(v interface{}) ([]byte, error) + MarshalIndent func(v interface{}, prefix, indent string) ([]byte, error) + MarshalToString func(v interface{}) (string, error) + NewDecoder func(reader io.Reader) *Decoder + NewEncoder func(writer io.Writer) *Encoder + RegisterExtension func(extension Extension) + Unmarshal func(data []byte, v interface{}) error + UnmarshalFromString func(str string, v interface{}) error + Valid func(data []byte) bool + type Any interface + Get func(path ...interface{}) Any + GetInterface func() interface{} + Keys func() []string + LastError func() error + MustBeValid func() Any + Size func() int + ToBool func() bool + ToFloat32 func() float32 + ToFloat64 func() float64 + ToInt func() int + ToInt32 func() int32 + ToInt64 func() int64 + ToString func() string + ToUint func() uint + ToUint32 func() uint32 + ToUint64 func() uint64 + ToVal func(val interface{}) + ValueType func() ValueType + WriteTo func(stream *Stream) + func Get(data []byte, path ...interface{}) Any + func Wrap(val interface{}) Any + func WrapFloat64(val float64) Any + func WrapInt32(val int32) Any + func WrapInt64(val int64) Any + func WrapString(val string) Any + func WrapUint32(val uint32) Any + func WrapUint64(val uint64) Any + type Binding struct + Decoder ValDecoder + Encoder ValEncoder + Field reflect2.StructField + FromNames []string + ToNames []string + type Config struct + CaseSensitive bool + DisallowUnknownFields bool + EscapeHTML bool + IndentionStep int + MarshalFloatWith6Digits bool + ObjectFieldMustBeSimpleString bool + OnlyTaggedField bool + SortMapKeys bool + TagKey string + UseNumber bool + ValidateJsonRawMessage bool + func (cfg Config) Froze() API + type Decoder struct + func NewDecoder(reader io.Reader) *Decoder + func (adapter *Decoder) Buffered() io.Reader + func (adapter *Decoder) Decode(obj interface{}) error + func (adapter *Decoder) DisallowUnknownFields() + func (adapter *Decoder) More() bool + func (adapter *Decoder) UseNumber() + type DecoderExtension map[reflect2.Type]ValDecoder + func (extension DecoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder + func (extension DecoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder + func (extension DecoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder + func (extension DecoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder + func (extension DecoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder + func (extension DecoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder + func (extension DecoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) + type DecoderFunc func(ptr unsafe.Pointer, iter *Iterator) + type DummyExtension struct + func (extension *DummyExtension) CreateDecoder(typ reflect2.Type) ValDecoder + func (extension *DummyExtension) CreateEncoder(typ reflect2.Type) ValEncoder + func (extension *DummyExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder + func (extension *DummyExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder + func (extension *DummyExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder + func (extension *DummyExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder + func (extension *DummyExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) + type Encoder struct + func NewEncoder(writer io.Writer) *Encoder + func (adapter *Encoder) Encode(val interface{}) error + func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) + func (adapter *Encoder) SetIndent(prefix, indent string) + type EncoderExtension map[reflect2.Type]ValEncoder + func (extension EncoderExtension) CreateDecoder(typ reflect2.Type) ValDecoder + func (extension EncoderExtension) CreateEncoder(typ reflect2.Type) ValEncoder + func (extension EncoderExtension) CreateMapKeyDecoder(typ reflect2.Type) ValDecoder + func (extension EncoderExtension) CreateMapKeyEncoder(typ reflect2.Type) ValEncoder + func (extension EncoderExtension) DecorateDecoder(typ reflect2.Type, decoder ValDecoder) ValDecoder + func (extension EncoderExtension) DecorateEncoder(typ reflect2.Type, encoder ValEncoder) ValEncoder + func (extension EncoderExtension) UpdateStructDescriptor(structDescriptor *StructDescriptor) + type EncoderFunc func(ptr unsafe.Pointer, stream *Stream) + type Extension interface + CreateDecoder func(typ reflect2.Type) ValDecoder + CreateEncoder func(typ reflect2.Type) ValEncoder + CreateMapKeyDecoder func(typ reflect2.Type) ValDecoder + CreateMapKeyEncoder func(typ reflect2.Type) ValEncoder + DecorateDecoder func(typ reflect2.Type, decoder ValDecoder) ValDecoder + DecorateEncoder func(typ reflect2.Type, encoder ValEncoder) ValEncoder + UpdateStructDescriptor func(structDescriptor *StructDescriptor) + type IsEmbeddedPtrNil interface + IsEmbeddedPtrNil func(ptr unsafe.Pointer) bool + type Iterator struct + Attachment interface{} + Error error + func NewIterator(cfg API) *Iterator + func Parse(cfg API, reader io.Reader, bufSize int) *Iterator + func ParseBytes(cfg API, input []byte) *Iterator + func ParseString(cfg API, input string) *Iterator + func (iter *Iterator) CurrentBuffer() string + func (iter *Iterator) Pool() IteratorPool + func (iter *Iterator) Read() interface{} + func (iter *Iterator) ReadAny() Any + func (iter *Iterator) ReadArray() (ret bool) + func (iter *Iterator) ReadArrayCB(callback func(*Iterator) bool) (ret bool) + func (iter *Iterator) ReadBigFloat() (ret *big.Float) + func (iter *Iterator) ReadBigInt() (ret *big.Int) + func (iter *Iterator) ReadBool() (ret bool) + func (iter *Iterator) ReadFloat32() (ret float32) + func (iter *Iterator) ReadFloat64() (ret float64) + func (iter *Iterator) ReadInt() int + func (iter *Iterator) ReadInt16() (ret int16) + func (iter *Iterator) ReadInt32() (ret int32) + func (iter *Iterator) ReadInt64() (ret int64) + func (iter *Iterator) ReadInt8() (ret int8) + func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool + func (iter *Iterator) ReadNil() (ret bool) + func (iter *Iterator) ReadNumber() (ret json.Number) + func (iter *Iterator) ReadObject() (ret string) + func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool + func (iter *Iterator) ReadString() (ret string) + func (iter *Iterator) ReadStringAsSlice() (ret []byte) + func (iter *Iterator) ReadUint() uint + func (iter *Iterator) ReadUint16() (ret uint16) + func (iter *Iterator) ReadUint32() (ret uint32) + func (iter *Iterator) ReadUint64() uint64 + func (iter *Iterator) ReadUint8() (ret uint8) + func (iter *Iterator) ReadVal(obj interface{}) + func (iter *Iterator) ReportError(operation string, msg string) + func (iter *Iterator) Reset(reader io.Reader) *Iterator + func (iter *Iterator) ResetBytes(input []byte) *Iterator + func (iter *Iterator) Skip() + func (iter *Iterator) SkipAndReturnBytes() []byte + func (iter *Iterator) WhatIsNext() ValueType + type IteratorPool interface + BorrowIterator func(data []byte) *Iterator + ReturnIterator func(iter *Iterator) + type Number string + func (n Number) Float64() (float64, error) + func (n Number) Int64() (int64, error) + func (n Number) String() string + type OptionalDecoder struct + ValueDecoder ValDecoder + ValueType reflect2.Type + func (decoder *OptionalDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) + type OptionalEncoder struct + ValueEncoder ValEncoder + func (encoder *OptionalEncoder) Encode(ptr unsafe.Pointer, stream *Stream) + func (encoder *OptionalEncoder) IsEmpty(ptr unsafe.Pointer) bool + type RawMessage []byte + type Stream struct + Attachment interface{} + Error error + func NewStream(cfg API, out io.Writer, bufSize int) *Stream + func (stream *Stream) Available() int + func (stream *Stream) Buffer() []byte + func (stream *Stream) Buffered() int + func (stream *Stream) Flush() error + func (stream *Stream) Pool() StreamPool + func (stream *Stream) Reset(out io.Writer) + func (stream *Stream) SetBuffer(buf []byte) + func (stream *Stream) Write(p []byte) (nn int, err error) + func (stream *Stream) WriteArrayEnd() + func (stream *Stream) WriteArrayStart() + func (stream *Stream) WriteBool(val bool) + func (stream *Stream) WriteEmptyArray() + func (stream *Stream) WriteEmptyObject() + func (stream *Stream) WriteFalse() + func (stream *Stream) WriteFloat32(val float32) + func (stream *Stream) WriteFloat32Lossy(val float32) + func (stream *Stream) WriteFloat64(val float64) + func (stream *Stream) WriteFloat64Lossy(val float64) + func (stream *Stream) WriteInt(val int) + func (stream *Stream) WriteInt16(nval int16) + func (stream *Stream) WriteInt32(nval int32) + func (stream *Stream) WriteInt64(nval int64) + func (stream *Stream) WriteInt8(nval int8) + func (stream *Stream) WriteMore() + func (stream *Stream) WriteNil() + func (stream *Stream) WriteObjectEnd() + func (stream *Stream) WriteObjectField(field string) + func (stream *Stream) WriteObjectStart() + func (stream *Stream) WriteRaw(s string) + func (stream *Stream) WriteString(s string) + func (stream *Stream) WriteStringWithHTMLEscaped(s string) + func (stream *Stream) WriteTrue() + func (stream *Stream) WriteUint(val uint) + func (stream *Stream) WriteUint16(val uint16) + func (stream *Stream) WriteUint32(val uint32) + func (stream *Stream) WriteUint64(val uint64) + func (stream *Stream) WriteUint8(val uint8) + func (stream *Stream) WriteVal(val interface{}) + type StreamPool interface + BorrowStream func(writer io.Writer) *Stream + ReturnStream func(stream *Stream) + type StructDescriptor struct + Fields []*Binding + Type reflect2.Type + func (structDescriptor *StructDescriptor) GetField(fieldName string) *Binding + type ValDecoder interface + Decode func(ptr unsafe.Pointer, iter *Iterator) + type ValEncoder interface + Encode func(ptr unsafe.Pointer, stream *Stream) + IsEmpty func(ptr unsafe.Pointer) bool + type ValueType int + const ArrayValue + const BoolValue + const InvalidValue + const NilValue + const NumberValue + const ObjectValue + const StringValue