package
2.1.0-rc.2+incompatible
Repository: https://github.com/coderushing/tidb.git
Documentation: pkg.go.dev
# Functions
CompareBinary compares two binary json objects.
ContainsBinary check whether JSON document contains specific target according the following rules: 1) object contains a target object if and only if every key is contained in source object and the value associated with the target key is contained in the value associated with the source key; 2) array contains a target nonarray if and only if the target is contained in some element of the array; 3) array contains a target array if and only if every element is contained in some element of the array; 4) scalar contains a target scalar if and only if they are comparable and are equal;.
CreateBinary creates a BinaryJSON from interface.
MergeBinary merges multiple BinaryJSON into one according the following rules: 1) adjacent arrays are merged to a single array; 2) adjacent object are merged to a single object; 3) a scalar value is autowrapped as an array before merge; 4) an adjacent array and object are merged by autowrapping the object as an array.
ParseBinaryFromString parses a json from string.
ParseJSONPathExpr parses a JSON path expression.
PeekBytesAsJSON trys to peek some bytes from b, until we can deserialize a JSON from those bytes.
# Constants
'all': 1 if all paths exist within the document, 0 otherwise.
'one': 1 if at least one path exists within the document, 0 otherwise.
LiteralFalse represents JSON false.
LiteralNil represents JSON null.
LiteralTrue represents JSON true.
ModifyInsert is for insert a new element into a JSON.
ModifyReplace is for replace an old elemList from a JSON.
ModifySet = ModifyInsert | ModifyReplace.
TypeCodeArray indicates the JSON is an array.
TypeCodeFloat64 indicates the JSON is a double float number.
TypeCodeInt64 indicates the JSON is a signed integer.
TypeCodeLiteral indicates the JSON is a literal.
TypeCodeObject indicates the JSON is an object.
TypeCodeString indicates the JSON is a string.
TypeCodeUint64 indicates the JSON is a unsigned integer.
# Variables
ErrInvalidJSONContainsPathType means invalid JSON contains path type.
ErrInvalidJSONData means invalid JSON data.
ErrInvalidJSONPath means invalid JSON path.
ErrInvalidJSONPathWildcard means invalid JSON path that contain wildcard characters.
ErrInvalidJSONText means invalid JSON text.
# Structs
BinaryJSON represents a binary encoded JSON object.
PathExpression is for JSON path expression.