mongo-driver: go.mongodb.org/mongo-driver/bson/bsonrw/bsonrwtest Index | Files

package bsonrwtest

import "go.mongodb.org/mongo-driver/bson/bsonrw/bsonrwtest"

Index

Package Files

bsonrwtest.go

type Invoked Uses

type Invoked byte

Invoked is a type used to indicate what method was called last.

const (
    Nothing Invoked = iota
    ReadArray
    ReadBinary
    ReadBoolean
    ReadDocument
    ReadCodeWithScope
    ReadDBPointer
    ReadDateTime
    ReadDecimal128
    ReadDouble
    ReadInt32
    ReadInt64
    ReadJavascript
    ReadMaxKey
    ReadMinKey
    ReadNull
    ReadObjectID
    ReadRegex
    ReadString
    ReadSymbol
    ReadTimestamp
    ReadUndefined
    ReadElement
    ReadValue
    WriteArray
    WriteBinary
    WriteBinaryWithSubtype
    WriteBoolean
    WriteCodeWithScope
    WriteDBPointer
    WriteDateTime
    WriteDecimal128
    WriteDouble
    WriteInt32
    WriteInt64
    WriteJavascript
    WriteMaxKey
    WriteMinKey
    WriteNull
    WriteObjectID
    WriteRegex
    WriteString
    WriteDocument
    WriteSymbol
    WriteTimestamp
    WriteUndefined
    WriteDocumentElement
    WriteDocumentEnd
    WriteArrayElement
    WriteArrayEnd
    Skip
)

These are the different methods that can be invoked.

func (Invoked) String Uses

func (i Invoked) String() string

type ValueReaderWriter Uses

type ValueReaderWriter struct {
    T        *testing.T
    Invoked  Invoked
    Return   interface{} // Can be a primitive or a bsoncore.Value
    BSONType bsontype.Type
    Err      error
    ErrAfter Invoked // error after this method is called
    // contains filtered or unexported fields
}

ValueReaderWriter is a test implementation of a bsonrw.ValueReader and bsonrw.ValueWriter

func (*ValueReaderWriter) ReadArray Uses

func (llvrw *ValueReaderWriter) ReadArray() (bsonrw.ArrayReader, error)

ReadArray implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadBinary Uses

func (llvrw *ValueReaderWriter) ReadBinary() (b []byte, btype byte, err error)

ReadBinary implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadBoolean Uses

func (llvrw *ValueReaderWriter) ReadBoolean() (bool, error)

ReadBoolean implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadCodeWithScope Uses

func (llvrw *ValueReaderWriter) ReadCodeWithScope() (code string, dr bsonrw.DocumentReader, err error)

ReadCodeWithScope implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadDBPointer Uses

func (llvrw *ValueReaderWriter) ReadDBPointer() (ns string, oid primitive.ObjectID, err error)

ReadDBPointer implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadDateTime Uses

func (llvrw *ValueReaderWriter) ReadDateTime() (int64, error)

ReadDateTime implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadDecimal128 Uses

func (llvrw *ValueReaderWriter) ReadDecimal128() (primitive.Decimal128, error)

ReadDecimal128 implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadDocument Uses

func (llvrw *ValueReaderWriter) ReadDocument() (bsonrw.DocumentReader, error)

ReadDocument implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadDouble Uses

func (llvrw *ValueReaderWriter) ReadDouble() (float64, error)

ReadDouble implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadElement Uses

func (llvrw *ValueReaderWriter) ReadElement() (string, bsonrw.ValueReader, error)

ReadElement implements the bsonrw.DocumentReader interface.

func (*ValueReaderWriter) ReadInt32 Uses

func (llvrw *ValueReaderWriter) ReadInt32() (int32, error)

ReadInt32 implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadInt64 Uses

func (llvrw *ValueReaderWriter) ReadInt64() (int64, error)

ReadInt64 implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadJavascript Uses

func (llvrw *ValueReaderWriter) ReadJavascript() (code string, err error)

ReadJavascript implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadMaxKey Uses

func (llvrw *ValueReaderWriter) ReadMaxKey() error

ReadMaxKey implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadMinKey Uses

func (llvrw *ValueReaderWriter) ReadMinKey() error

ReadMinKey implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadNull Uses

func (llvrw *ValueReaderWriter) ReadNull() error

ReadNull implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadObjectID Uses

func (llvrw *ValueReaderWriter) ReadObjectID() (primitive.ObjectID, error)

ReadObjectID implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadRegex Uses

func (llvrw *ValueReaderWriter) ReadRegex() (pattern string, options string, err error)

ReadRegex implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadString Uses

func (llvrw *ValueReaderWriter) ReadString() (string, error)

ReadString implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadSymbol Uses

func (llvrw *ValueReaderWriter) ReadSymbol() (symbol string, err error)

ReadSymbol implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadTimestamp Uses

func (llvrw *ValueReaderWriter) ReadTimestamp() (t uint32, i uint32, err error)

ReadTimestamp implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadUndefined Uses

func (llvrw *ValueReaderWriter) ReadUndefined() error

ReadUndefined implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) ReadValue Uses

func (llvrw *ValueReaderWriter) ReadValue() (bsonrw.ValueReader, error)

ReadValue implements the bsonrw.ArrayReader interface.

func (*ValueReaderWriter) Skip Uses

func (llvrw *ValueReaderWriter) Skip() error

Skip implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) Type Uses

func (llvrw *ValueReaderWriter) Type() bsontype.Type

Type implements the bsonrw.ValueReader interface.

func (*ValueReaderWriter) WriteArray Uses

func (llvrw *ValueReaderWriter) WriteArray() (bsonrw.ArrayWriter, error)

WriteArray implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteArrayElement Uses

func (llvrw *ValueReaderWriter) WriteArrayElement() (bsonrw.ValueWriter, error)

WriteArrayElement implements the bsonrw.ArrayWriter interface.

func (*ValueReaderWriter) WriteArrayEnd Uses

func (llvrw *ValueReaderWriter) WriteArrayEnd() error

WriteArrayEnd implements the bsonrw.ArrayWriter interface.

func (*ValueReaderWriter) WriteBinary Uses

func (llvrw *ValueReaderWriter) WriteBinary(b []byte) error

WriteBinary implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteBinaryWithSubtype Uses

func (llvrw *ValueReaderWriter) WriteBinaryWithSubtype(b []byte, btype byte) error

WriteBinaryWithSubtype implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteBoolean Uses

func (llvrw *ValueReaderWriter) WriteBoolean(bool) error

WriteBoolean implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteCodeWithScope Uses

func (llvrw *ValueReaderWriter) WriteCodeWithScope(code string) (bsonrw.DocumentWriter, error)

WriteCodeWithScope implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteDBPointer Uses

func (llvrw *ValueReaderWriter) WriteDBPointer(ns string, oid primitive.ObjectID) error

WriteDBPointer implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteDateTime Uses

func (llvrw *ValueReaderWriter) WriteDateTime(dt int64) error

WriteDateTime implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteDecimal128 Uses

func (llvrw *ValueReaderWriter) WriteDecimal128(primitive.Decimal128) error

WriteDecimal128 implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteDocument Uses

func (llvrw *ValueReaderWriter) WriteDocument() (bsonrw.DocumentWriter, error)

WriteDocument implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteDocumentElement Uses

func (llvrw *ValueReaderWriter) WriteDocumentElement(string) (bsonrw.ValueWriter, error)

WriteDocumentElement implements the bsonrw.DocumentWriter interface.

func (*ValueReaderWriter) WriteDocumentEnd Uses

func (llvrw *ValueReaderWriter) WriteDocumentEnd() error

WriteDocumentEnd implements the bsonrw.DocumentWriter interface.

func (*ValueReaderWriter) WriteDouble Uses

func (llvrw *ValueReaderWriter) WriteDouble(float64) error

WriteDouble implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteInt32 Uses

func (llvrw *ValueReaderWriter) WriteInt32(int32) error

WriteInt32 implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteInt64 Uses

func (llvrw *ValueReaderWriter) WriteInt64(int64) error

WriteInt64 implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteJavascript Uses

func (llvrw *ValueReaderWriter) WriteJavascript(code string) error

WriteJavascript implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteMaxKey Uses

func (llvrw *ValueReaderWriter) WriteMaxKey() error

WriteMaxKey implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteMinKey Uses

func (llvrw *ValueReaderWriter) WriteMinKey() error

WriteMinKey implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteNull Uses

func (llvrw *ValueReaderWriter) WriteNull() error

WriteNull implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteObjectID Uses

func (llvrw *ValueReaderWriter) WriteObjectID(primitive.ObjectID) error

WriteObjectID implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteRegex Uses

func (llvrw *ValueReaderWriter) WriteRegex(pattern string, options string) error

WriteRegex implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteString Uses

func (llvrw *ValueReaderWriter) WriteString(string) error

WriteString implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteSymbol Uses

func (llvrw *ValueReaderWriter) WriteSymbol(symbol string) error

WriteSymbol implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteTimestamp Uses

func (llvrw *ValueReaderWriter) WriteTimestamp(t uint32, i uint32) error

WriteTimestamp implements the bsonrw.ValueWriter interface.

func (*ValueReaderWriter) WriteUndefined Uses

func (llvrw *ValueReaderWriter) WriteUndefined() error

WriteUndefined implements the bsonrw.ValueWriter interface.

Package bsonrwtest imports 5 packages (graph). Updated 2019-02-24. Refresh now. Tools for package owners.