xbson

package
v0.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBsonRegistryBuilder = NewBsonRegistryBuilder()

Functions

func BuildDefaultRegistry added in v0.34.0

func BuildDefaultRegistry()

BuildDefaultRegistry builds the default registry to be used by the mongo driver Previous registries are discarded

func BuildRegistry added in v0.34.0

func BuildRegistry() *bsoncodec.Registry

BuildRegistry creates a new registry configured with the default encoders and decoders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types, the PrimitiveCodecs type in this package, and all registered registrars.

func Dump added in v0.35.0

func Dump(t *testing.T, title string, bytes []byte)

func IsAlreadyRegistered added in v0.34.0

func IsAlreadyRegistered(registrar Registrar) bool

IsAlreadyRegistered checks if a Registrar is already registered.

func MarshalWithRegistry added in v0.44.1

func MarshalWithRegistry(registry *bsoncodec.Registry, value interface{}) ([]byte, error)

func Register added in v0.34.0

func Register(registrar Registrar)

Register registers a Registrar to the list of registrars. If the Registrar is already registered, it will not be registered again. This function is not thread-safe, and it is typically called from init() functions.

func UnmarshalWithRegistry added in v0.44.1

func UnmarshalWithRegistry(registry *bsoncodec.Registry, bs []byte, value interface{})