Versions in this module Expand all Collapse all v1 v1.4.1 Sep 27, 2020 Changes in this version + var ErrEOA = errors.New("end of array") + var ErrEOD = errors.New("end of document") + var ErrInvalidJSON = errors.New("invalid JSON input") + func CopyDocument(dst ValueWriter, src ValueReader) error + type ArrayReader interface + ReadValue func() (ValueReader, error) + type ArrayWriter interface + WriteArrayElement func() (ValueWriter, error) + WriteArrayEnd func() error + type BSONValueReaderPool struct + func NewBSONValueReaderPool() *BSONValueReaderPool + func (bvrp *BSONValueReaderPool) Get(src []byte) ValueReader + func (bvrp *BSONValueReaderPool) Put(vr ValueReader) (ok bool) + type BSONValueWriterPool struct + func NewBSONValueWriterPool() *BSONValueWriterPool + func (bvwp *BSONValueWriterPool) Get(w io.Writer) ValueWriter + func (bvwp *BSONValueWriterPool) Put(vw ValueWriter) (ok bool) + type BytesReader interface + ReadValueBytes func(dst []byte) (bsontype.Type, []byte, error) + type BytesWriter interface + WriteValueBytes func(t bsontype.Type, b []byte) error + type Copier struct + func NewCopier() Copier + func (c Copier) AppendDocumentBytes(dst []byte, src ValueReader) ([]byte, error) + func (c Copier) AppendValueBytes(dst []byte, src ValueReader) (bsontype.Type, []byte, error) + func (c Copier) CopyBytesToDocumentWriter(dst DocumentWriter, src []byte) error + func (c Copier) CopyDocument(dst ValueWriter, src ValueReader) error + func (c Copier) CopyDocumentFromBytes(dst ValueWriter, src []byte) error + func (c Copier) CopyDocumentToBytes(src ValueReader) ([]byte, error) + func (c Copier) CopyValue(dst ValueWriter, src ValueReader) error + func (c Copier) CopyValueFromBytes(dst ValueWriter, t bsontype.Type, src []byte) error + func (c Copier) CopyValueToBytes(src ValueReader) (bsontype.Type, []byte, error) + type DocumentReader interface + ReadElement func() (string, ValueReader, error) + type DocumentWriter interface + WriteDocumentElement func(string) (ValueWriter, error) + WriteDocumentEnd func() error + type ExtJSONValueReaderPool struct + func NewExtJSONValueReaderPool() *ExtJSONValueReaderPool + func (bvrp *ExtJSONValueReaderPool) Get(r io.Reader, canonical bool) (ValueReader, error) + func (bvrp *ExtJSONValueReaderPool) Put(vr ValueReader) (ok bool) + type ExtJSONValueWriterPool struct + func NewExtJSONValueWriterPool() *ExtJSONValueWriterPool + func (bvwp *ExtJSONValueWriterPool) Get(w io.Writer, canonical, escapeHTML bool) ValueWriter + func (bvwp *ExtJSONValueWriterPool) Put(vw ValueWriter) (ok bool) + type SliceWriter []byte + func (sw *SliceWriter) Write(p []byte) (int, error) + type TransitionError struct + func (te TransitionError) Error() string + type ValueReader interface + ReadArray func() (ArrayReader, error) + ReadBinary func() (b []byte, btype byte, err error) + ReadBoolean func() (bool, error) + ReadCodeWithScope func() (code string, dr DocumentReader, err error) + ReadDBPointer func() (ns string, oid primitive.ObjectID, err error) + ReadDateTime func() (int64, error) + ReadDecimal128 func() (primitive.Decimal128, error) + ReadDocument func() (DocumentReader, error) + ReadDouble func() (float64, error) + ReadInt32 func() (int32, error) + ReadInt64 func() (int64, error) + ReadJavascript func() (code string, err error) + ReadMaxKey func() error + ReadMinKey func() error + ReadNull func() error + ReadObjectID func() (primitive.ObjectID, error) + ReadRegex func() (pattern, options string, err error) + ReadString func() (string, error) + ReadSymbol func() (symbol string, err error) + ReadTimestamp func() (t, i uint32, err error) + ReadUndefined func() error + Skip func() error + Type func() bsontype.Type + func NewBSONDocumentReader(b []byte) ValueReader + func NewBSONValueReader(t bsontype.Type, val []byte) ValueReader + func NewExtJSONValueReader(r io.Reader, canonical bool) (ValueReader, error) + type ValueWriter interface + WriteArray func() (ArrayWriter, error) + WriteBinary func(b []byte) error + WriteBinaryWithSubtype func(b []byte, btype byte) error + WriteBoolean func(bool) error + WriteCodeWithScope func(code string) (DocumentWriter, error) + WriteDBPointer func(ns string, oid primitive.ObjectID) error + WriteDateTime func(dt int64) error + WriteDecimal128 func(primitive.Decimal128) error + WriteDocument func() (DocumentWriter, error) + WriteDouble func(float64) error + WriteInt32 func(int32) error + WriteInt64 func(int64) error + WriteJavascript func(code string) error + WriteMaxKey func() error + WriteMinKey func() error + WriteNull func() error + WriteObjectID func(primitive.ObjectID) error + WriteRegex func(pattern, options string) error + WriteString func(string) error + WriteSymbol func(symbol string) error + WriteTimestamp func(t, i uint32) error + WriteUndefined func() error + func NewBSONValueWriter(w io.Writer) (ValueWriter, error) + func NewExtJSONValueWriter(w io.Writer, canonical, escapeHTML bool) (ValueWriter, error)