Versions in this module Expand all Collapse all v1 v1.2.1 Jan 8, 2020 v1.2.0 Dec 10, 2019 Changes in this version + const ReplicaSet + const Sharded + const Single + const TestDb + var Background = context.Background() + var LocalRc = readconcern.Local() + var MajorityRc = readconcern.Majority() + var MajorityWc = writeconcern.New(writeconcern.WMajority()) + var PrimaryRp = readpref.Primary() + func CreateCommandErrorResponse(ce CommandError) bson.D + func CreateCursorResponse(cursorID int64, ns string, identifier BatchIdentifier, batch ...bson.D) bson.D + func CreateSuccessResponse(elems ...bson.E) bson.D + func CreateWriteConcernErrorResponse(wce WriteConcernError) bson.D + func CreateWriteErrorsResponse(writeErrorrs ...WriteError) bson.D + func Setup() error + func Teardown() error + type BatchIdentifier string + const FirstBatch + const NextBatch + type ClientType int + const Default + const Mock + const Pinned + type Collection struct + Client *mongo.Client + CreateOpts bson.D + DB string + Name string + Opts *options.CollectionOptions + type CommandError struct + Code int32 + Labels []string + Message string + Name string + type FailPoint struct + ConfigureFailPoint string + Data FailPointData + Mode interface{} + type FailPointData struct + CloseConnection bool + ErrorCode int32 + FailBeforeCommitExceptionCode int32 + FailCommands []string + WriteConcernError ... + type FailPointMode struct + Skip int32 + Times int32 + type Options struct + func NewOptions() *Options + func (op *Options) Auth(auth bool) *Options + func (op *Options) ClientOptions(opts *options.ClientOptions) *Options + func (op *Options) ClientType(ct ClientType) *Options + func (op *Options) CollectionCreateOptions(opts bson.D) *Options + func (op *Options) CollectionName(collName string) *Options + func (op *Options) CollectionOptions(opts *options.CollectionOptions) *Options + func (op *Options) CreateClient(create bool) *Options + func (op *Options) DatabaseName(dbName string) *Options + func (op *Options) Enterprise(ent bool) *Options + func (op *Options) MaxServerVersion(version string) *Options + func (op *Options) MinServerVersion(version string) *Options + func (op *Options) MockResponses(responses ...bson.D) *Options + func (op *Options) RunOn(blocks ...RunOnBlock) *Options + func (op *Options) ShareClient(share bool) *Options + func (op *Options) Topologies(topos ...TopologyKind) *Options + type RunOnBlock struct + MaxServerVersion string + MinServerVersion string + Topology []TopologyKind + type T struct + Client *mongo.Client + Coll *mongo.Collection + DB *mongo.Database + func New(wrapped *testing.T, opts ...*Options) *T + func (T) GlobalClient() *mongo.Client + func (t *T) AddMockResponses(responses ...bson.D) + func (t *T) AuthEnabled() bool + func (t *T) ClearCollections() + func (t *T) ClearEvents() + func (t *T) ClearFailPoints() + func (t *T) ClearMockResponses() + func (t *T) CloneCollection(opts *options.CollectionOptions) + func (t *T) CloneDatabase(opts *options.DatabaseOptions) + func (t *T) Close() + func (t *T) ConnString() string + func (t *T) CreateCollection(coll Collection, createOnServer bool) *mongo.Collection + func (t *T) GetAllFailedEvents() []*event.CommandFailedEvent + func (t *T) GetAllStartedEvents() []*event.CommandStartedEvent + func (t *T) GetAllSucceededEvents() []*event.CommandSucceededEvent + func (t *T) GetFailedEvent() *event.CommandFailedEvent + func (t *T) GetStartedEvent() *event.CommandStartedEvent + func (t *T) GetSucceededEvent() *event.CommandSucceededEvent + func (t *T) ResetClient(opts *options.ClientOptions) + func (t *T) Run(name string, callback func(*T)) + func (t *T) RunOpts(name string, opts *Options, callback func(*T)) + func (t *T) SetFailPoint(fp FailPoint) + func (t *T) TopologyKind() TopologyKind + func (t *T) TrackFailPoint(fpName string) + type TopologyKind string + type WriteConcernError struct + Code int + Details bson.Raw + Message string + Name string + type WriteError struct + Code int + Index int + Message string