Versions in this module Expand all Collapse all v0 v0.0.2 Mar 6, 2018 v0.0.1 Feb 13, 2018 Changes in this version + var ErrTooShort = errors.New("builder: The provided slice's length is too short") + type ArrayBuilder struct + func (ab *ArrayBuilder) Append(elems ...ArrayElementer) *ArrayBuilder + type ArrayConstructor struct + var AC ArrayConstructor + func (ArrayConstructor) Array(arr *ArrayBuilder) ArrayElementFunc + func (ArrayConstructor) ArrayWithElements(elems ...ArrayElementer) ArrayElementFunc + func (ArrayConstructor) Binary(b []byte) ArrayElementFunc + func (ArrayConstructor) BinaryWithSubtype(b []byte, btype byte) ArrayElementFunc + func (ArrayConstructor) Boolean(b bool) ArrayElementFunc + func (ArrayConstructor) CodeWithScope(code string, scope []byte) ArrayElementFunc + func (ArrayConstructor) DBPointer(ns string, oid objectid.ObjectID) ArrayElementFunc + func (ArrayConstructor) DateTime(dt int64) ArrayElementFunc + func (ArrayConstructor) Decimal(d decimal.Decimal128) ArrayElementFunc + func (ArrayConstructor) Double(f float64) ArrayElementFunc + func (ArrayConstructor) Int32(i int32) ArrayElementFunc + func (ArrayConstructor) Int64(i int64) ArrayElementFunc + func (ArrayConstructor) JavaScriptCode(code string) ArrayElementFunc + func (ArrayConstructor) MaxKey() ArrayElementFunc + func (ArrayConstructor) MinKey() ArrayElementFunc + func (ArrayConstructor) Null() ArrayElementFunc + func (ArrayConstructor) ObjectID(oid objectid.ObjectID) ArrayElementFunc + func (ArrayConstructor) Regex(pattern string, options string) ArrayElementFunc + func (ArrayConstructor) String(s string) ArrayElementFunc + func (ArrayConstructor) SubDocument(db *DocumentBuilder) ArrayElementFunc + func (ArrayConstructor) SubDocumentWithElements(elems ...Elementer) ArrayElementFunc + func (ArrayConstructor) Symbol(symbol string) ArrayElementFunc + func (ArrayConstructor) Timestamp(t uint32, i uint32) ArrayElementFunc + func (ArrayConstructor) Undefined() ArrayElementFunc + type ArrayElementFunc func(pos uint) Elementer + func (aef ArrayElementFunc) ArrayElement(pos uint) Elementer + type ArrayElementer interface + ArrayElement func(pos uint) Elementer + type Constructor struct + var C Constructor + func (Constructor) BinaryWithSubtype(key string, b []byte, btype byte) ElementFunc + func (Constructor) Boolean(key string, b bool) ElementFunc + func (Constructor) CodeWithScope(key string, code string, scope []byte) ElementFunc + func (Constructor) DBPointer(key string, ns string, oid objectid.ObjectID) ElementFunc + func (Constructor) DateTime(key string, dt int64) ElementFunc + func (Constructor) Decimal(key string, d decimal.Decimal128) ElementFunc + func (Constructor) Double(key string, f float64) ElementFunc + func (Constructor) Int32(key string, i int32) ElementFunc + func (Constructor) Int64(key string, i int64) ElementFunc + func (Constructor) JavaScriptCode(key string, code string) ElementFunc + func (Constructor) MaxKey(key string) ElementFunc + func (Constructor) MinKey(key string) ElementFunc + func (Constructor) Null(key string) ElementFunc + func (Constructor) ObjectID(key string, oid objectid.ObjectID) ElementFunc + func (Constructor) Regex(key string, pattern, options string) ElementFunc + func (Constructor) String(key string, value string) ElementFunc + func (Constructor) SubDocument(key string, subdoc *DocumentBuilder) Elementer + func (Constructor) Symbol(key string, symbol string) ElementFunc + func (Constructor) Timestamp(key string, t uint32, i uint32) ElementFunc + func (Constructor) Undefined(key string) ElementFunc + func (c Constructor) Array(key string, array *ArrayBuilder) ElementFunc + func (c Constructor) ArrayWithElements(key string, elems ...ArrayElementer) ElementFunc + func (c Constructor) Binary(key string, b []byte) ElementFunc + func (c Constructor) SubDocumentWithElements(key string, elems ...Elementer) Elementer + type DocumentBuilder struct + Key string + func NewDocumentBuilder() *DocumentBuilder + func (db *DocumentBuilder) Append(elems ...Elementer) *DocumentBuilder + func (db *DocumentBuilder) Element() (ElementSizer, ElementWriter) + func (db *DocumentBuilder) RequiredBytes() uint + func (db *DocumentBuilder) WriteDocument(writer []byte) (int64, error) + type ElementFunc func() (ElementSizer, ElementWriter) + func (ef ElementFunc) Element() (ElementSizer, ElementWriter) + type ElementSizer func() (size uint) + type ElementWriter func(start uint, writer []byte) (n int, err error) + type Elementer interface + Element func() (ElementSizer, ElementWriter)