# Packages
Package bsoncodec provides a system for encoding values to BSON representations and decoding values from BSON representations.
Package bsonrw contains abstractions for reading and writing BSON and BSON like types from sources.
Package bsontype is a utility package that contains types for each BSON type and the a stringifier for the Type to enable easier debugging when working with BSON.
Package primitive contains types similar to Go primitives for BSON types can do not have direct Go primitive representations.
# Functions
Marshal returns the BSON encoding of val.
MarshalAppend will append the BSON encoding of val to dst.
MarshalAppendWithContext will append the BSON encoding of val to dst using EncodeContext ec.
MarshalAppendWithRegistry will append the BSON encoding of val to dst using Registry r.
MarshalExtJSON returns the extended JSON encoding of val.
MarshalExtJSONAppend will append the extended JSON encoding of val to dst.
MarshalExtJSONAppendWithContext will append the extended JSON encoding of val to dst using Registry r.
MarshalExtJSONAppendWithRegistry will append the extended JSON encoding of val to dst using Registry r.
MarshalExtJSONWithContext returns the extended JSON encoding of val using Registry r.
MarshalExtJSONWithRegistry returns the extended JSON encoding of val using Registry r.
MarshalWithContext returns the BSON encoding of val using EncodeContext ec.
MarshalWithRegistry returns the BSON encoding of val using Registry r.
NewDecoder returns a new decoder that uses the DefaultRegistry to read from vr.
NewDecoderWithContext returns a new decoder that uses DecodeContext dc to read from vr.
NewEncoder returns a new encoder that uses the DefaultRegistry to write to vw.
NewEncoderWithContext returns a new encoder that uses EncodeContext ec to write to vw.
NewFromIOReader reads in a document from the given io.Reader and constructs a Raw from it.
NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and deocders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the PrimitiveCodecs type in this package.
Unmarshal parses the BSON-encoded data and stores the result in the value pointed to by val.
UnmarshalExtJSON parses the extended JSON-encoded data and stores the result in the value pointed to by val.
UnmarshalExtJSONWithContext parses the extended JSON-encoded data using DecodeContext dc and stores the result in the value pointed to by val.
UnmarshalExtJSONWithRegistry parses the extended JSON-encoded data using Registry r and stores the result in the value pointed to by val.
UnmarshalWithContext parses the BSON-encoded data using DecodeContext dc and stores the result in the value pointed to by val.
UnmarshalWithRegistry parses the BSON-encoded data using Registry r and stores the result in the value pointed to by val.
# Constants
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
These constants uniquely refer to each BSON type.
# Variables
DefaultRegistry is the default bsoncodec.Registry.
ErrNilContext is returned when the provided DecodeContext is nil.
ErrNilReader indicates that an operation was attempted on a nil bson.Reader.
ErrNilRegistry is returned when the provided registry is nil.
# Structs
A Decoder reads and decodes BSON documents from a stream.
An Encoder writes a serialization format to an output stream.
PrimitiveCodecs is a namespace for all of the default bsoncodec.Codecs for the primitive types defined in this package.
RawValue represents a BSON value in byte form.
# Interfaces
Marshaler is an interface implemented by types that can marshal themselves into a BSON document represented as bytes.
Unmarshaler is an interface implemented by types that can unmarshal a BSON document representation of themselves.
ValueMarshaler is an interface implemented by types that can marshal themselves into a BSON value as bytes.
ValueUnmarshaler is an interface implemented by types that can unmarshal a BSON value representaiton of themselves.
Zeroer allows custom struct types to implement a report of zero state.