Discover Packages
github.com/zhenxxin/mongo-go-driver
bson
elements
package
Version:
v0.0.8
Opens a new window with list of versions in this module.
Published: Jun 25, 2018
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation Source Files Overview Index Constants Variables Functions Types type ArrayNS type BSONByteNS type BinNS type BooleanNS type CStringNS type CodeWithScopeNS type DBPointerNS type DatetimeNS type Decimal128NS type DocumentNS type DoubleNS type Int32NS type Int64NS type JavaScriptNS type ObjectIDNS type RegexNS type StringNS type SymbolNS type TimestampNS Element(start, writer, key, arr) Encode(start, writer, arr) Encode(start, writer, t) Element(start, writer, key, b, btype) Encode(start, writer, b, btype) Element(start, writer, key, b) Encode(start, writer, b) Encode(start, writer, str) Element(start, writer, key, code, scope) Encode(start, writer, code, doc) Element(start, writer, key, ns, oid) Encode(start, writer, ns, oid) Element(start, writer, key, dt) Encode(start, writer, dt) Element(start, writer, key, d) Encode(start, writer, d) Element(start, writer, key, doc) Encode(start, writer, doc) Element(start, writer, key, f) Encode(start, writer, f) Element(start, writer, key, i) Encode(start, writer, i) Element(start, writer, key, i) Encode(start, writer, i) Element(start, writer, key, code) Encode(start, writer, code) Element(start, writer, key, oid) Encode(start, writer, oid) Element(start, writer, key, pattern, options) Encode(start, writer, pattern, options) Element(start, writer, key, s) Encode(start, writer, s) Element(start, writer, key, symbol) Encode(start, writer, symbol) Element(start, writer, key, t, i) Encode(start, writer, t, i)
Documentation
¶
Package elements holds the logic to encode and decode the BSON element types
from native Go to BSON binary and vice versa.
These are low level helper methods, so they do not encode or decode BSON
elements, only the specific types, e.g. these methods do not encode, decode,
or identify a BSON element, so they won't read the identifier byte and they
won't parse out the key string. There are encoder and decoder helper methods
for the CString BSON element type, so this package can be used to parse
keys.
These variables are used as namespaces for methods pertaining to encoding individual BSON types.
ErrTooSmall indicates that slice provided to encode into is not large enough to fit the data.
ArrayNS is a namespace for encoding BSON Array elements.
Element encodes an array and a key into a BSON array element and serializes the bytes to the
provided writer.
Encode encodes an array into a BSON array element and serializes the bytes to the
provided writer.
BSONByteNS is a namespace for encoding a single byte.
Encode encodes a C-style string into a BSON CString element and serializes the bytes to the
provided writer.
BinNS is a namespace for encoding BSON Binary elements.
Element encodes a []byte and a key into a BSON binary element and serializes the bytes to the
provided writer.
Encode encodes a []byte into a BSON binary element and serializes the bytes to the
provided writer.
BooleanNS is a namespace for encoding BSON Boolean elements.
Element encodes a boolean and a key into a BSON boolean element and serializes the bytes to the
provided writer.
Encode encodes a boolean into a BSON boolean element and serializes the bytes to the
provided writer.
CStringNS is a namespace for encoding BSON CString elements.
Encode encodes a C-style string into a BSON CString element and serializes the bytes to the
provided writer.
type CodeWithScopeNS struct{}
CodeWithScopeNS is a namespace for encoding BSON CodeWithScope elements.
Element encodes a code and scope doc and a key into a BSON CodeWithScope element and serializes the bytes to the
provided writer.
Encode encodes a code and scope doc into a BSON CodeWithScope element and serializes the bytes to the
provided writer.
type DBPointerNS struct{}
DBPointerNS is a namespace for encoding BSON DBPointer elements.
Element encodes a DBPointer and a key into a BSON DBPointer element and serializes the bytes to the
provided writer.
Encode encodes a DBPointer into a BSON DBPointer element and serializes the bytes to the
provided writer.
DatetimeNS is a namespace for encoding BSON Datetime elements.
Element encodes a Datetime and a key into a BSON Datetime element and serializes the bytes to the
provided writer.
Encode encodes a Datetime into a BSON Datetime element and serializes the bytes to the
provided writer.
type Decimal128NS struct{}
Decimal128NS is a namespace for encoding BSON Decimal128 elements.
Element encodes a decimal128 and a key into a BSON decimal128 element and serializes the bytes to the
provided writer.
Encode encodes a decimal128 into a BSON decimal128 element and serializes the bytes to the
provided writer.
DocumentNS is a namespace for encoding BSON Document elements.
Element encodes a Document and a key into a BSON document element and serializes the bytes to the
provided writer.
Encode encodes a Document into a BSON document element and serializes the bytes to the
provided writer.
DoubleNS is a namespace for encoding BSON Double elements.
Element encodes a float64 and a key into a BSON double element and serializes the bytes to the
provided writer.
Encode encodes a float64 into a BSON double element and serializes the bytes to the
provided writer.
Int32NS is a namespace for encoding BSON Int32 elements.
Element encodes an int32 and a key into a BSON int32 element and serializes the bytes to the
provided writer.
Encode encodes an int32 into a BSON int32 element and serializes the bytes to the
provided writer.
Int64NS is a namespace for encoding BSON Int64 elements.
Element encodes a int64 and a key into a BSON int64 element and serializes the bytes to the
provided writer.
Encode encodes a int64 into a BSON int64 element and serializes the bytes to the
provided writer.
type JavaScriptNS struct{}
JavaScriptNS is a namespace for encoding BSON JavaScript elements.
Element encodes a JavaScript string and a key into a BSON JavaScript element and serializes the bytes to the
provided writer.
Encode encodes a JavaScript string into a BSON JavaScript element and serializes the bytes to the
provided writer.
ObjectIDNS is a namespace for encoding BSON ObjectID elements.
Element encodes a ObjectID and a key into a BSON ObjectID element and serializes the bytes to the
provided writer.
Encode encodes an ObjectID into a BSON ObjectID element and serializes the bytes to the
provided writer.
RegexNS is a namespace for encoding BSON Regex elements.
Element encodes a regex and a key into a BSON regex element and serializes the bytes to the
provided writer.
Encode encodes a regex into a BSON regex element and serializes the bytes to the
provided writer.
StringNS is a namespace for encoding BSON String elements.
Element encodes a string and a key into a BSON string element and serializes the bytes to the
provided writer.
Encode encodes a string into a BSON string element and serializes the bytes to the
provided writer.
SymbolNS is a namespace for encoding BSON Symbol elements.
Element encodes a symbol and a key into a BSON symbol element and serializes the bytes to the
provided writer.
Encode encodes a symbol into a BSON symbol element and serializes the bytes to the
provided writer.
type TimestampNS struct{}
TimestampNS is a namespace for encoding Timestamp Double elements.
Element encodes a timestamp and a key into a BSON timestamp element and serializes the bytes to the
provided writer.
Encode encodes a timestamp into a BSON timestamp element and serializes the bytes to the
provided writer.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.