package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
AllPaths returns a slice of new JSON documents, each a path to a leaf through the input.
AsStringWithErrorChance returns string representation of JSON object, but allows up to specified chance that the returned string will contain errors -- i.e.
Contains returns true if a contains b.
DecodeJSON decodes a value encoded with EncodeJSON.
DeepInsert inserts a value at a path in a JSON document.
DeepSet sets a path to a value in a JSON document.
EncodeContainedInvertedIndexSpans takes in a key prefix and returns the spans that must be scanned in the inverted index to evaluate a contained by (<@) predicate with the given JSON (i.e., find the objects in the index that could be contained by the given JSON).
EncodeContainingInvertedIndexSpans takes in a key prefix and returns the spans that must be scanned in the inverted index to evaluate a contains (@>) predicate with the given JSON (i.e., find the objects in the index that contain the given JSON).
EncodeExistsInvertedIndexSpans takes in a key prefix and returns the spans that must be scanned in the inverted index to evaluate an exists (?) predicate with the given JSON (i.e., find the objects/arrays in the index that contain the given string as a key, or *are* the given string).
EncodeInvertedIndexKeys takes in a key prefix and returns a slice of inverted index keys, one per unique path through the receiver.
EncodeJSON encodes a JSON value as a sequence of bytes.
FetchPath implements the #> operator.
FromBool returns a JSON value given a bool.
FromDecimal returns a JSON value given a apd.Decimal.
FromEncoding returns a JSON value which is lazily decoded.
FromFloat64 returns a JSON value given a float64.
FromInt returns a JSON value given a int.
FromInt64 returns a JSON value given a int64.
FromNumber returns a JSON value given a json.Number.
FromString returns a JSON value given a string.
MakeJSON returns a JSON value given a Go-style representation of JSON.
NewArrayBuilder returns an ArrayBuilder.
NewArrayBuilderWithCounter returns an ArrayBuilderWithCounter.
NewFixedKeysObjectBuilder creates JSON object builder for the specified set of fixed, unique keys.
NewObjectBuilder returns an ObjectBuilder.
NewObjectBuilderWithCounter creates and instantiates ObjectBuilder with memory counter.
NumInvertedIndexEntries returns the number of inverted index entries that would be created for the given JSON value.
ParseJSON takes a string of JSON and returns a JSON value.
Pretty pretty-prints the given JSON document as required by jsonb_pretty.
RandGen generates a random JSON value configured with specified options.
Random generates a random JSON value.
WithComplexity returns an option to set maximum complexity of JSON objects.
WithEscapeProb returns an option that configures the probability of producing escaped character in JSON.
WithFastJSONParser returns an option that forces the use of fast json parser.
WithGoStandardParser returns an option that forces the use of Go parser (encoding/json).
WithMaxStrLen returns an option to set maximum length of random JSON string objects.
WithUnorderedObjectKeys returns an option that leaves JSON object keys unordered.
# Constants
This enum defines the ordering of types.
This enum defines the ordering of types.
This enum defines the ordering of types.
This enum defines the ordering of types.
This enum defines the ordering of types.
This enum defines the ordering of types.
This enum defines the ordering of types.
# Variables
FalseJSONValue is JSON `false`.
NullJSONValue is JSON `null`.
TrueJSONValue is JSON `true`.
# Structs
ArrayBuilder builds JSON Array by a JSON sequence.
ArrayBuilderWithCounter builds JSON Array by a JSON sequence with a size counter.
FixedKeysObjectBuilder is a JSON object builder that builds an object for the specified fixed set of unique keys.
ObjectBuilder builds JSON Object by a key value pair sequence.
ObjectBuilderWithCounter builds a JSON object a key/value pair at a time, keeping the memory usage of the object.
ObjectIterator is an iterator to access the key value pair of an object in sorted order based on key.
# Interfaces
JSON represents a JSON value.
ParseOption is an option for JSON parsing.
RandOption is an option to control generation of random json.
# Type aliases
Type represents a JSON type.