Versions in this module Expand all Collapse all v1 v1.4.1 Sep 27, 2020 Changes in this version + var DefaultRegistry = NewRegistryBuilder().Build() + var ErrNilArray = errors.New("array is nil") + var ErrNilDocument = errors.New("document is nil") + func NewRegistryBuilder() *bsoncodec.RegistryBuilder + type Arr []Val + func (a *Arr) UnmarshalBSONValue(t bsontype.Type, data []byte) error + func (a Arr) Equal(a2 Arr) bool + func (a Arr) MarshalBSONValue() (bsontype.Type, []byte, error) + func (a Arr) String() string + type Doc []Elem + func ReadDoc(b []byte) (Doc, error) + func (d *Doc) UnmarshalBSON(b []byte) error + func (d *Doc) UnmarshalBSONValue(t bsontype.Type, data []byte) error + func (d Doc) Append(key string, val Val) Doc + func (d Doc) AppendMarshalBSON(dst []byte) ([]byte, error) + func (d Doc) Copy() Doc + func (d Doc) Delete(key string) Doc + func (d Doc) Equal(id IDoc) bool + func (d Doc) IndexOf(key string) int + func (d Doc) Lookup(key ...string) Val + func (d Doc) LookupElement(key ...string) Elem + func (d Doc) LookupElementErr(key ...string) (Elem, error) + func (d Doc) LookupErr(key ...string) (Val, error) + func (d Doc) MarshalBSON() ([]byte, error) + func (d Doc) MarshalBSONValue() (bsontype.Type, []byte, error) + func (d Doc) Prepend(key string, val Val) Doc + func (d Doc) Set(key string, val Val) Doc + func (d Doc) String() string + type Elem struct + Key string + Value Val + func (e Elem) Equal(e2 Elem) bool + func (e Elem) String() string + type ElementTypeError struct + Method string + Type bsontype.Type + func (ete ElementTypeError) Error() string + type IDoc interface + type KeyNotFound struct + Depth uint + Key []string + Type bsontype.Type + func (knf KeyNotFound) Error() string + type MDoc map[string]Val + func ReadMDoc(b []byte) (MDoc, error) + func (d *MDoc) UnmarshalBSON(b []byte) error + func (d MDoc) AppendMarshalBSON(dst []byte) ([]byte, error) + func (d MDoc) Copy() MDoc + func (d MDoc) Equal(id IDoc) bool + func (d MDoc) Lookup(key ...string) Val + func (d MDoc) LookupElement(key ...string) Elem + func (d MDoc) LookupElementErr(key ...string) (Elem, error) + func (d MDoc) LookupErr(key ...string) (Val, error) + func (d MDoc) MarshalBSON() ([]byte, error) + func (d MDoc) MarshalBSONValue() (bsontype.Type, []byte, error) + func (d MDoc) String() string + type PrimitiveCodecs struct + func (pc PrimitiveCodecs) ArrayDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error + func (pc PrimitiveCodecs) ArrayEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error + func (pc PrimitiveCodecs) DecodeDocument(dctx bsoncodec.DecodeContext, dr bsonrw.DocumentReader, pdoc *Doc) error + func (pc PrimitiveCodecs) DocumentDecodeValue(dctx bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error + func (pc PrimitiveCodecs) DocumentEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error + func (pc PrimitiveCodecs) ElementSliceDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error + func (pc PrimitiveCodecs) ElementSliceEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error + func (pc PrimitiveCodecs) RegisterPrimitiveCodecs(rb *bsoncodec.RegistryBuilder) + func (pc PrimitiveCodecs) ValueDecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error + func (pc PrimitiveCodecs) ValueEncodeValue(ec bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error + type Val struct + func Array(arr Arr) Val + func Binary(subtype byte, data []byte) Val + func Boolean(b bool) Val + func CodeWithScope(code string, scope IDoc) Val + func DBPointer(ns string, ptr primitive.ObjectID) Val + func DateTime(dt int64) Val + func Decimal128(d128 primitive.Decimal128) Val + func Document(doc IDoc) Val + func Double(f64 float64) Val + func Int32(i32 int32) Val + func Int64(i64 int64) Val + func JavaScript(js string) Val + func MaxKey() Val + func MinKey() Val + func Null() Val + func ObjectID(oid primitive.ObjectID) Val + func Regex(pattern, options string) Val + func String(str string) Val + func Symbol(symbol string) Val + func Time(t time.Time) Val + func Timestamp(t, i uint32) Val + func Undefined() Val + func (v *Val) UnmarshalBSONValue(t bsontype.Type, data []byte) error + func (v Val) Array() Arr + func (v Val) ArrayOK() (Arr, bool) + func (v Val) Binary() (byte, []byte) + func (v Val) BinaryOK() (byte, []byte, bool) + func (v Val) Boolean() bool + func (v Val) BooleanOK() (bool, bool) + func (v Val) CodeWithScope() (string, Doc) + func (v Val) CodeWithScopeOK() (string, Doc, bool) + func (v Val) DBPointer() (string, primitive.ObjectID) + func (v Val) DBPointerOK() (string, primitive.ObjectID, bool) + func (v Val) DateTime() int64 + func (v Val) DateTimeOK() (int64, bool) + func (v Val) Decimal128() primitive.Decimal128 + func (v Val) Decimal128OK() (primitive.Decimal128, bool) + func (v Val) Document() Doc + func (v Val) DocumentOK() (Doc, bool) + func (v Val) Double() float64 + func (v Val) DoubleOK() (float64, bool) + func (v Val) Equal(v2 Val) bool + func (v Val) Int32() int32 + func (v Val) Int32OK() (int32, bool) + func (v Val) Int64() int64 + func (v Val) Int64OK() (int64, bool) + func (v Val) Interface() interface{} + func (v Val) IsNumber() bool + func (v Val) IsZero() bool + func (v Val) JavaScript() string + func (v Val) JavaScriptOK() (string, bool) + func (v Val) MDocument() MDoc + func (v Val) MDocumentOK() (MDoc, bool) + func (v Val) MarshalAppendBSONValue(dst []byte) (bsontype.Type, []byte, error) + func (v Val) MarshalBSONValue() (bsontype.Type, []byte, error) + func (v Val) MaxKey() + func (v Val) MaxKeyOK() bool + func (v Val) MinKey() + func (v Val) MinKeyOK() bool + func (v Val) Null() + func (v Val) NullOK() bool + func (v Val) ObjectID() primitive.ObjectID + func (v Val) ObjectIDOK() (primitive.ObjectID, bool) + func (v Val) Regex() (pattern, options string) + func (v Val) RegexOK() (pattern, options string, ok bool) + func (v Val) String() string + func (v Val) StringValue() string + func (v Val) StringValueOK() (string, bool) + func (v Val) Symbol() string + func (v Val) SymbolOK() (string, bool) + func (v Val) Time() time.Time + func (v Val) TimeOK() (time.Time, bool) + func (v Val) Timestamp() (t, i uint32) + func (v Val) TimestampOK() (t uint32, i uint32, ok bool) + func (v Val) Type() bsontype.Type + func (v Val) Undefined() + func (v Val) UndefinedOK() bool