Versions in this module Expand all Collapse all v0 v0.0.1 Apr 29, 2022 Changes in this version + var BuilderKeyAlreadyWrittenError = errors.New("builder key already written") + var BuilderKeyMustBeStringError = errors.New("builder key must be string") + var BuilderNeedOpenArrayError = errors.New("builder need open array") + var BuilderNeedOpenCompoundError = errors.New("builder need open array or object") + var BuilderNeedOpenObjectError = errors.New("builder need open object") + var BuilderNeedSubValueError = errors.New("builder need sub value") + var BuilderNotClosedError = errors.New("builder not closed") + var Cause = func(err error) error + var DuplicateAttributeNameError = errors.New("duplicate key name") + var IndexOutOfBoundsError = errors.New("index out of range") + var InternalError = errors.New("internal") + var InvalidUtf8SequenceError = errors.New("invalid utf8 sequence") + var IsBuilderKeyAlreadyWritten = isCausedByFunc(BuilderKeyAlreadyWrittenError) + var IsBuilderKeyMustBeString = isCausedByFunc(BuilderKeyMustBeStringError) + var IsBuilderNeedOpenArray = isCausedByFunc(BuilderNeedOpenArrayError) + var IsBuilderNeedOpenCompound = isCausedByFunc(BuilderNeedOpenCompoundError) + var IsBuilderNeedOpenObject = isCausedByFunc(BuilderNeedOpenObjectError) + var IsBuilderNeedSubValue = isCausedByFunc(BuilderNeedSubValueError) + var IsBuilderNotClosed = isCausedByFunc(BuilderNotClosedError) + var IsDuplicateAttributeName = isCausedByFunc(DuplicateAttributeNameError) + var IsIndexOutOfBounds = isCausedByFunc(IndexOutOfBoundsError) + var IsInternal = isCausedByFunc(InternalError) + var IsInvalidUtf8Sequence = isCausedByFunc(InvalidUtf8SequenceError) + var IsNeedAttributeTranslator = isCausedByFunc(NeedAttributeTranslatorError) + var IsNoJSONEquivalent = isCausedByFunc(NoJSONEquivalentError) + var IsNumberOutOfRange = isCausedByFunc(NumberOutOfRangeError) + var NeedAttributeTranslatorError = errors.New("need attribute translator") + var NoJSONEquivalentError = errors.New("no JSON equivalent") + var NumberOutOfRangeError = errors.New("number out of range") + var WithStack = func(err error) error + func IsBuilderUnexpectedType(err error) bool + func IsInvalidType(err error) bool + func IsInvalidUnmarshal(err error) bool + func IsMarshaler(err error) bool + func IsParse(err error) bool + func IsUnmarshalType(err error) bool + func IsUnsupportedType(err error) bool + func Unmarshal(data Slice, v interface{}) error + type ArrayIterator struct + func NewArrayIterator(s Slice) (*ArrayIterator, error) + func (i *ArrayIterator) IsFirst() bool + func (i *ArrayIterator) IsValid() bool + func (i *ArrayIterator) Next() error + func (i *ArrayIterator) Value() (Slice, error) + type Builder struct + func NewBuilder(capacity uint) *Builder + func (b *Builder) Add(v interface{}) error + func (b *Builder) AddKeyValue(key string, v Value) error + func (b *Builder) AddKeyValuesFromIterator(it *ObjectIterator) error + func (b *Builder) AddValue(v Value) error + func (b *Builder) AddValuesFromIterator(it *ArrayIterator) error + func (b *Builder) Bytes() ([]byte, error) + func (b *Builder) Clear() + func (b *Builder) Close() error + func (b *Builder) GetKey(key string) (Slice, error) + func (b *Builder) HasKey(key string) (bool, error) + func (b *Builder) IsClosed() bool + func (b *Builder) IsEmpty() bool + func (b *Builder) IsOpenArray() bool + func (b *Builder) IsOpenObject() bool + func (b *Builder) OpenArray(unindexed ...bool) error + func (b *Builder) OpenObject(unindexed ...bool) error + func (b *Builder) RemoveLast() error + func (b *Builder) Size() (ValueLength, error) + func (b *Builder) Slice() (Slice, error) + func (b *Builder) WriteTo(w io.Writer) (int64, error) + type BuilderOptions struct + BuildUnindexedArrays bool + BuildUnindexedObjects bool + CheckAttributeUniqueness bool + type BuilderUnexpectedTypeError struct + Message string + func (e BuilderUnexpectedTypeError) Error() string + type Decoder struct + func NewDecoder(r io.Reader) *Decoder + func (e *Decoder) Decode(v interface{}) error + type Dumper struct + func NewDumper(w io.Writer, options *DumperOptions) *Dumper + func (d *Dumper) Append(s Slice) error + type DumperOptions struct + EscapeForwardSlashes bool + EscapeUnicode bool + UnsupportedTypeBehavior UnsupportedTypeBehavior + type Encoder struct + func NewEncoder(w io.Writer) *Encoder + func (e *Encoder) Builder() *Builder + func (e *Encoder) Encode(v interface{}) (err error) + type InvalidTypeError struct + Message string + func (e InvalidTypeError) Error() string + type InvalidUnmarshalError struct + Type reflect.Type + func (e *InvalidUnmarshalError) Error() string + type Marshaler interface + MarshalVPack func() (Slice, error) + type MarshalerError struct + Err error + Type reflect.Type + func (e MarshalerError) Error() string + type ObjectIterator struct + func NewObjectIterator(s Slice, allowRandomIteration ...bool) (*ObjectIterator, error) + func (i *ObjectIterator) IsFirst() bool + func (i *ObjectIterator) IsValid() bool + func (i *ObjectIterator) Key(translate bool) (Slice, error) + func (i *ObjectIterator) Next() error + func (i *ObjectIterator) Value() (Slice, error) + type ParseError struct + Offset int64 + func (e *ParseError) Error() string + type Parser struct + func NewParser(r io.Reader, builder *Builder, options ...ParserOptions) *Parser + func (p *Parser) Parse() error + type ParserOptions struct + BuildUnindexedArrays bool + BuildUnindexedObjects bool + type RawSlice []byte + func (m *RawSlice) UnmarshalVPack(data Slice) error + func (m RawSlice) MarshalVPack() (Slice, error) + type Slice []byte + func EmptyArraySlice() Slice + func EmptyObjectSlice() Slice + func FalseSlice() Slice + func IllegalSlice() Slice + func Marshal(v interface{}) (result Slice, err error) + func MaxKeySlice() Slice + func Merge(slices ...Slice) (Slice, error) + func MinKeySlice() Slice + func NoneSlice() Slice + func NullSlice() Slice + func ParseJSON(r io.Reader, options ...ParserOptions) (Slice, error) + func ParseJSONFromString(json string, options ...ParserOptions) (Slice, error) + func ParseJSONFromUTF8(json []byte, options ...ParserOptions) (Slice, error) + func SliceFromHex(v string) Slice + func SliceFromReader(r io.Reader) (Slice, error) + func StringSlice(s string) Slice + func TrueSlice() Slice + func ZeroSlice() Slice + func (s Slice) AssertType(t ValueType) error + func (s Slice) AssertTypeAny(t ...ValueType) error + func (s Slice) At(index ValueLength) (Slice, error) + func (s Slice) ByteSize() (ValueLength, error) + func (s Slice) CompareString(value string) (int, error) + func (s Slice) Get(attributePath ...string) (Slice, error) + func (s Slice) GetBinary() ([]byte, error) + func (s Slice) GetBinaryLength() (ValueLength, error) + func (s Slice) GetBool() (bool, error) + func (s Slice) GetDouble() (float64, error) + func (s Slice) GetInt() (int64, error) + func (s Slice) GetSmallInt() (int64, error) + func (s Slice) GetString() (string, error) + func (s Slice) GetStringLength() (ValueLength, error) + func (s Slice) GetStringUTF8() ([]byte, error) + func (s Slice) GetUInt() (uint64, error) + func (s Slice) GetUTCDate() (time.Time, error) + func (s Slice) HasKey(keyPath ...string) (bool, error) + func (s Slice) IsArray() bool + func (s Slice) IsBCD() bool + func (s Slice) IsBinary() bool + func (s Slice) IsBool() bool + func (s Slice) IsCustom() bool + func (s Slice) IsDouble() bool + func (s Slice) IsEmptyArray() bool + func (s Slice) IsEmptyObject() bool + func (s Slice) IsEqualString(value string) (bool, error) + func (s Slice) IsExternal() bool + func (s Slice) IsFalse() bool + func (s Slice) IsIllegal() bool + func (s Slice) IsInt() bool + func (s Slice) IsInteger() bool + func (s Slice) IsMaxKey() bool + func (s Slice) IsMinKey() bool + func (s Slice) IsNone() bool + func (s Slice) IsNull() bool + func (s Slice) IsNumber() bool + func (s Slice) IsObject() bool + func (s Slice) IsSmallInt() bool + func (s Slice) IsSorted() bool + func (s Slice) IsString() bool + func (s Slice) IsTrue() bool + func (s Slice) IsType(t ValueType) bool + func (s Slice) IsUInt() bool + func (s Slice) IsUTCDate() bool + func (s Slice) JSONString(options ...DumperOptions) (string, error) + func (s Slice) KeyAt(index ValueLength, translate ...bool) (Slice, error) + func (s Slice) Length() (ValueLength, error) + func (s Slice) Next() (Slice, error) + func (s Slice) String() string + func (s Slice) Type() ValueType + func (s Slice) ValueAt(index ValueLength) (Slice, error) + type UnmarshalTypeError struct + Field string + Struct string + Type reflect.Type + Value string + func (e *UnmarshalTypeError) Error() string + type Unmarshaler interface + UnmarshalVPack func(Slice) error + type UnsupportedTypeBehavior int + const ConvertUnsupportedType + const FailOnUnsupportedType + const NullifyUnsupportedType + type UnsupportedTypeError struct + Type reflect.Type + func (e UnsupportedTypeError) Error() string + type Value struct + func NewArrayValue(unindexed ...bool) Value + func NewBinaryValue(value []byte) Value + func NewBoolValue(value bool) Value + func NewDoubleValue(value float64) Value + func NewIntValue(value int64) Value + func NewMaxKeyValue() Value + func NewMinKeyValue() Value + func NewNullValue() Value + func NewObjectValue(unindexed ...bool) Value + func NewReflectValue(v reflect.Value) Value + func NewSliceValue(value Slice) Value + func NewStringValue(value string) Value + func NewUIntValue(value uint64) Value + func NewUTCDateValue(value time.Time) Value + func NewValue(value interface{}) Value + func (v Value) IsIllegal() bool + func (v Value) IsSlice() bool + func (v Value) Type() ValueType + type ValueLength uint64 + func (s ValueLength) String() string + type ValueType int + const Array + const BCD + const Binary + const Bool + const Custom + const Double + const External + const Illegal + const Int + const MaxKey + const MinKey + const None + const Null + const Object + const SmallInt + const String + const UInt + const UTCDate + func (vt ValueType) String() string