# Packages
Package encoding defines types that deal with document encoding.
# Functions
ArrayContains iterates over a and returns whether v is equal to one of its values.
ArrayLength returns the length of an array.
Fields returns a list of all the fields at the root of the document sorted lexicographically.
No description provided by the author
Length returns the length of a document.
MapScan decodes the document into a map.
MarshalJSON encodes a document to json.
MarshalJSONArray encodes an array to json.
NewArrayValue returns a value of type Array.
NewBlobValue encodes x and returns a value.
NewBoolValue encodes x and returns a value.
NewDocumentValue returns a value of type Document.
NewDoubleValue encodes x and returns a value.
NewFieldBuffer creates a FieldBuffer.
NewFromCSV takes a list of headers and columns and returns a document.
NewFromJSON creates a document from raw JSON data.
NewFromMap creates a document from a map.
NewFromStruct creates a document from a struct using reflection.
NewIntegerValue encodes x and returns a value whose type depends on the magnitude of x.
NewNullValue returns a Null value.
NewPath creates a path from a list of strings representing either a field name or an array index in string form.
NewTextValue encodes x and returns a value.
NewValue creates a value whose type is infered from x.
NewValueBuffer creates a buffer of values.
NewValueEncoder creates a ValueEncoder that writes to w.
Scan each field of the document into the given variables.
ScanDocument scans a document into dest which must be either a struct pointer, a map or a map pointer.
ScanIterator scans a document iterator into a slice or fixed size array.
ScanValue scans v into t.
SliceScan scans a document array into a slice or fixed size array.
SortArray creates a new sorted array.
StructScan scans d into t.
# Constants
denote the absence of type.
ArrayEnd is the final separator used when encoding document.Array in binary reprsentation.
array family: 0xE0 to 0xEF.
ArrayValueDelim is a separator used when encoding document.Array in binary reprsentation.
blob family: 0xD0 to 0xDF.
List of supported value types.
document family: 0xF0 to 0xFF.
double family: 0xA0 to 0xAF.
integer family: 0x90 to 0x9F.
List of supported value types.
string family: 0xC0 to 0xCF.
# Variables
ErrFieldNotFound must be returned by Document implementations, when calling the GetByField method and the field wasn't found in the document.
ErrValueNotFound must be returned by Array implementations, when calling the GetByIndex method and the index wasn't found in the array.
# Structs
ErrUnsupportedType is used to skip struct or array fields that are not supported.
FieldBuffer stores a group of fields in memory.
PathFragment is a fragment of a path representing either a field name or the index of an array.
A Value stores encoded data alongside its type.
ValueBuffer is an array that holds values in memory.
ValueEncoder encodes natural sort-ordered representations of values.