Versions in this module Expand all Collapse all v0 v0.23.2 Feb 12, 2024 Changes in this version + var FalseJSONValue = jsonFalse + var NullJSONValue = jsonNull + var TrueJSONValue = jsonTrue + func AsStringWithErrorChance(j JSON, rng *rand.Rand, p float32) string + func Contains(a, b JSON) (bool, error) + func EncodeContainedInvertedIndexSpans(b []byte, json JSON) (invertedExpr inverted.Expression, err error) + func EncodeContainingInvertedIndexSpans(b []byte, json JSON) (invertedExpr inverted.Expression, err error) + func EncodeExistsInvertedIndexSpans(b []byte, s string) (invertedExpr inverted.Expression, err error) + func EncodeInvertedIndexKeys(b []byte, json JSON) ([][]byte, error) + func EncodeJSON(appendTo []byte, j JSON) ([]byte, error) + func NumInvertedIndexEntries(j JSON) (int, error) + func Pretty(j JSON) (string, error) + type ArrayBuilder struct + func NewArrayBuilder(numAddsHint int) *ArrayBuilder + func (b *ArrayBuilder) Add(j JSON) + func (b *ArrayBuilder) Build() JSON + type ArrayBuilderWithCounter struct + func NewArrayBuilderWithCounter() *ArrayBuilderWithCounter + func (b *ArrayBuilderWithCounter) Add(j JSON) + func (b *ArrayBuilderWithCounter) Build() JSON + func (b *ArrayBuilderWithCounter) Size() uintptr + type FixedKeysObjectBuilder struct + func NewFixedKeysObjectBuilder(keys []string) (*FixedKeysObjectBuilder, error) + func (b *FixedKeysObjectBuilder) Build() (JSON, error) + func (b *FixedKeysObjectBuilder) Set(k string, v JSON) error + type JSON interface + AreKeysSorted func() bool + AsArray func() ([]JSON, bool) + AsBool func() (bool, bool) + AsDecimal func() (*apd.Decimal, bool) + AsText func() (*string, error) + Compare func(JSON) (int, error) + Concat func(other JSON) (JSON, error) + EncodeForwardIndex func(buf []byte, dir encoding.Direction) ([]byte, error) + Exists func(string) (bool, error) + FetchValIdx func(idx int) (JSON, error) + FetchValKey func(key string) (JSON, error) + FetchValKeyOrIdx func(key string) (JSON, error) + Format func(buf *bytes.Buffer) + HasContainerLeaf func() (bool, error) + Len func() int + MaybeDecode func() JSON + ObjectIter func() (*ObjectIterator, error) + RemoveIndex func(idx int) (JSON, bool, error) + RemovePath func(path []string) (JSON, bool, error) + RemoveString func(s string) (JSON, bool, error) + Size func() uintptr + StripNulls func() (JSON, bool, error) + Type func() Type + func AllPaths(j JSON) ([]JSON, error) + func DecodeJSON(b []byte) ([]byte, JSON, error) + func DeepInsert(j JSON, path []string, to JSON, insertAfter bool) (JSON, error) + func DeepSet(j JSON, path []string, to JSON, createMissing bool) (JSON, error) + func FetchPath(j JSON, path []string) (JSON, error) + func FromBool(v bool) JSON + func FromDecimal(v apd.Decimal) JSON + func FromEncoding(b []byte) (JSON, error) + func FromFloat64(v float64) (JSON, error) + func FromInt(v int) JSON + func FromInt64(v int64) JSON + func FromNumber(v json.Number) (JSON, error) + func FromSpatialObject(so geopb.SpatialObject, numDecimalDigits int) (JSON, error) + func FromString(v string) JSON + func MakeJSON(d interface{}) (JSON, error) + func ParseJSON(s string, opts ...ParseOption) (JSON, error) + func RandGen(rng *rand.Rand, opts ...RandOption) (JSON, error) + func Random(complexity int, rng *rand.Rand) (JSON, error) + type ObjectBuilder struct + func NewObjectBuilder(numAddsHint int) *ObjectBuilder + func (b *ObjectBuilder) Add(k string, v JSON) + func (b *ObjectBuilder) Build() JSON + type ObjectBuilderWithCounter struct + func NewObjectBuilderWithCounter() *ObjectBuilderWithCounter + func (b *ObjectBuilderWithCounter) Add(k string, v JSON) + func (b *ObjectBuilderWithCounter) Build() JSON + func (b *ObjectBuilderWithCounter) Size() uintptr + type ObjectIterator struct + func (it *ObjectIterator) Key() string + func (it *ObjectIterator) Next() bool + func (it *ObjectIterator) Value() JSON + type ParseOption interface + func WithFastJSONParser() ParseOption + func WithGoStandardParser() ParseOption + func WithUnorderedObjectKeys() ParseOption + type RandOption interface + func WithComplexity(c int) RandOption + func WithEscapeProb(p float32) RandOption + func WithMaxStrLen(l int) RandOption + type Type int + const ArrayJSONType + const FalseJSONType + const NullJSONType + const NumberJSONType + const ObjectJSONType + const StringJSONType + const TrueJSONType + func (t Type) String() string