mongomock

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockCollection

type MockCollection struct {
	mock.Mock
}

MockCollection is an autogenerated mock type for the Collection type

func NewMockCollection

func NewMockCollection(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCollection

NewMockCollection creates a new instance of MockCollection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCollection) Aggregate

func (_mock *MockCollection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)

Aggregate provides a mock function for the type MockCollection

func (*MockCollection) BulkWrite

func (_mock *MockCollection) BulkWrite(ctx context.Context, models []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error)

BulkWrite provides a mock function for the type MockCollection

func (*MockCollection) CountDocuments

func (_mock *MockCollection) CountDocuments(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error)

CountDocuments provides a mock function for the type MockCollection

func (*MockCollection) Database

func (_mock *MockCollection) Database() *mongo.Database

Database provides a mock function for the type MockCollection

func (*MockCollection) DeleteMany

func (_mock *MockCollection) DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

DeleteMany provides a mock function for the type MockCollection

func (*MockCollection) DeleteOne

func (_mock *MockCollection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

DeleteOne provides a mock function for the type MockCollection

func (*MockCollection) Distinct

func (_mock *MockCollection) Distinct(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)

Distinct provides a mock function for the type MockCollection

func (*MockCollection) Drop

func (_mock *MockCollection) Drop(ctx context.Context) error

Drop provides a mock function for the type MockCollection

func (*MockCollection) EXPECT

func (*MockCollection) Find

func (_mock *MockCollection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)

Find provides a mock function for the type MockCollection

func (*MockCollection) FindOne

func (_mock *MockCollection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult

FindOne provides a mock function for the type MockCollection

func (*MockCollection) FindOneAndDelete

func (_mock *MockCollection) FindOneAndDelete(ctx context.Context, filter interface{}, opts ...*options.FindOneAndDeleteOptions) *mongo.SingleResult

FindOneAndDelete provides a mock function for the type MockCollection

func (*MockCollection) FindOneAndReplace

func (_mock *MockCollection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) *mongo.SingleResult

FindOneAndReplace provides a mock function for the type MockCollection

func (*MockCollection) FindOneAndUpdate

func (_mock *MockCollection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult

FindOneAndUpdate provides a mock function for the type MockCollection

func (*MockCollection) Indexes

func (_mock *MockCollection) Indexes() mongo.IndexView

Indexes provides a mock function for the type MockCollection

func (*MockCollection) InsertMany

func (_mock *MockCollection) InsertMany(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)

InsertMany provides a mock function for the type MockCollection

func (*MockCollection) InsertOne

func (_mock *MockCollection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

InsertOne provides a mock function for the type MockCollection

func (*MockCollection) Name

func (_mock *MockCollection) Name() string

Name provides a mock function for the type MockCollection

func (*MockCollection) ReplaceOne

func (_mock *MockCollection) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)

ReplaceOne provides a mock function for the type MockCollection

func (*MockCollection) UpdateMany

func (_mock *MockCollection) UpdateMany(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

UpdateMany provides a mock function for the type MockCollection

func (*MockCollection) UpdateOne

func (_mock *MockCollection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

UpdateOne provides a mock function for the type MockCollection

type MockCollection_Aggregate_Call

type MockCollection_Aggregate_Call struct {
	*mock.Call
}

MockCollection_Aggregate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Aggregate'

func (*MockCollection_Aggregate_Call) Return

func (*MockCollection_Aggregate_Call) Run

func (_c *MockCollection_Aggregate_Call) Run(run func(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions)) *MockCollection_Aggregate_Call

func (*MockCollection_Aggregate_Call) RunAndReturn

func (_c *MockCollection_Aggregate_Call) RunAndReturn(run func(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)) *MockCollection_Aggregate_Call

type MockCollection_BulkWrite_Call

type MockCollection_BulkWrite_Call struct {
	*mock.Call
}

MockCollection_BulkWrite_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BulkWrite'

func (*MockCollection_BulkWrite_Call) Return

func (*MockCollection_BulkWrite_Call) Run

func (*MockCollection_BulkWrite_Call) RunAndReturn

type MockCollection_CountDocuments_Call

type MockCollection_CountDocuments_Call struct {
	*mock.Call
}

MockCollection_CountDocuments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountDocuments'

func (*MockCollection_CountDocuments_Call) Return

func (*MockCollection_CountDocuments_Call) Run

func (_c *MockCollection_CountDocuments_Call) Run(run func(ctx context.Context, filter interface{}, opts ...*options.CountOptions)) *MockCollection_CountDocuments_Call

func (*MockCollection_CountDocuments_Call) RunAndReturn

func (_c *MockCollection_CountDocuments_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error)) *MockCollection_CountDocuments_Call

type MockCollection_Database_Call

type MockCollection_Database_Call struct {
	*mock.Call
}

MockCollection_Database_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Database'

func (*MockCollection_Database_Call) Return

func (*MockCollection_Database_Call) Run

func (*MockCollection_Database_Call) RunAndReturn

type MockCollection_DeleteMany_Call

type MockCollection_DeleteMany_Call struct {
	*mock.Call
}

MockCollection_DeleteMany_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteMany'

func (*MockCollection_DeleteMany_Call) Return

func (*MockCollection_DeleteMany_Call) Run

func (_c *MockCollection_DeleteMany_Call) Run(run func(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions)) *MockCollection_DeleteMany_Call

func (*MockCollection_DeleteMany_Call) RunAndReturn

func (_c *MockCollection_DeleteMany_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)) *MockCollection_DeleteMany_Call

type MockCollection_DeleteOne_Call

type MockCollection_DeleteOne_Call struct {
	*mock.Call
}

MockCollection_DeleteOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOne'

func (*MockCollection_DeleteOne_Call) Return

func (*MockCollection_DeleteOne_Call) Run

func (_c *MockCollection_DeleteOne_Call) Run(run func(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions)) *MockCollection_DeleteOne_Call

func (*MockCollection_DeleteOne_Call) RunAndReturn

func (_c *MockCollection_DeleteOne_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)) *MockCollection_DeleteOne_Call

type MockCollection_Distinct_Call

type MockCollection_Distinct_Call struct {
	*mock.Call
}

MockCollection_Distinct_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Distinct'

func (*MockCollection_Distinct_Call) Return

func (_c *MockCollection_Distinct_Call) Return(ifaceVals []interface{}, err error) *MockCollection_Distinct_Call

func (*MockCollection_Distinct_Call) Run

func (_c *MockCollection_Distinct_Call) Run(run func(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions)) *MockCollection_Distinct_Call

func (*MockCollection_Distinct_Call) RunAndReturn

func (_c *MockCollection_Distinct_Call) RunAndReturn(run func(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)) *MockCollection_Distinct_Call

type MockCollection_Drop_Call

type MockCollection_Drop_Call struct {
	*mock.Call
}

MockCollection_Drop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Drop'

func (*MockCollection_Drop_Call) Return

func (*MockCollection_Drop_Call) Run

func (*MockCollection_Drop_Call) RunAndReturn

func (_c *MockCollection_Drop_Call) RunAndReturn(run func(ctx context.Context) error) *MockCollection_Drop_Call

type MockCollection_Expecter

type MockCollection_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockCollection_Expecter) Aggregate

func (_e *MockCollection_Expecter) Aggregate(ctx interface{}, pipeline interface{}, opts ...interface{}) *MockCollection_Aggregate_Call

Aggregate is a helper method to define mock.On call

  • ctx context.Context
  • pipeline interface{}
  • opts ...*options.AggregateOptions

func (*MockCollection_Expecter) BulkWrite

func (_e *MockCollection_Expecter) BulkWrite(ctx interface{}, models interface{}, opts ...interface{}) *MockCollection_BulkWrite_Call

BulkWrite is a helper method to define mock.On call

  • ctx context.Context
  • models []mongo.WriteModel
  • opts ...*options.BulkWriteOptions

func (*MockCollection_Expecter) CountDocuments

func (_e *MockCollection_Expecter) CountDocuments(ctx interface{}, filter interface{}, opts ...interface{}) *MockCollection_CountDocuments_Call

CountDocuments is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • opts ...*options.CountOptions

func (*MockCollection_Expecter) Database

Database is a helper method to define mock.On call

func (*MockCollection_Expecter) DeleteMany

func (_e *MockCollection_Expecter) DeleteMany(ctx interface{}, filter interface{}, opts ...interface{}) *MockCollection_DeleteMany_Call

DeleteMany is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • opts ...*options.DeleteOptions

func (*MockCollection_Expecter) DeleteOne

func (_e *MockCollection_Expecter) DeleteOne(ctx interface{}, filter interface{}, opts ...interface{}) *MockCollection_DeleteOne_Call

DeleteOne is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • opts ...*options.DeleteOptions

func (*MockCollection_Expecter) Distinct

func (_e *MockCollection_Expecter) Distinct(ctx interface{}, fieldName interface{}, filter interface{}, opts ...interface{}) *MockCollection_Distinct_Call

Distinct is a helper method to define mock.On call

  • ctx context.Context
  • fieldName string
  • filter interface{}
  • opts ...*options.DistinctOptions

func (*MockCollection_Expecter) Drop

func (_e *MockCollection_Expecter) Drop(ctx interface{}) *MockCollection_Drop_Call

Drop is a helper method to define mock.On call

  • ctx context.Context

func (*MockCollection_Expecter) Find

func (_e *MockCollection_Expecter) Find(ctx interface{}, filter interface{}, opts ...interface{}) *MockCollection_Find_Call

Find is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • opts ...*options.FindOptions

func (*MockCollection_Expecter) FindOne

func (_e *MockCollection_Expecter) FindOne(ctx interface{}, filter interface{}, opts ...interface{}) *MockCollection_FindOne_Call

FindOne is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • opts ...*options.FindOneOptions

func (*MockCollection_Expecter) FindOneAndDelete

func (_e *MockCollection_Expecter) FindOneAndDelete(ctx interface{}, filter interface{}, opts ...interface{}) *MockCollection_FindOneAndDelete_Call

FindOneAndDelete is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • opts ...*options.FindOneAndDeleteOptions

func (*MockCollection_Expecter) FindOneAndReplace

func (_e *MockCollection_Expecter) FindOneAndReplace(ctx interface{}, filter interface{}, replacement interface{}, opts ...interface{}) *MockCollection_FindOneAndReplace_Call

FindOneAndReplace is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • replacement interface{}
  • opts ...*options.FindOneAndReplaceOptions

func (*MockCollection_Expecter) FindOneAndUpdate

func (_e *MockCollection_Expecter) FindOneAndUpdate(ctx interface{}, filter interface{}, update interface{}, opts ...interface{}) *MockCollection_FindOneAndUpdate_Call

FindOneAndUpdate is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • update interface{}
  • opts ...*options.FindOneAndUpdateOptions

func (*MockCollection_Expecter) Indexes

Indexes is a helper method to define mock.On call

func (*MockCollection_Expecter) InsertMany

func (_e *MockCollection_Expecter) InsertMany(ctx interface{}, documents interface{}, opts ...interface{}) *MockCollection_InsertMany_Call

InsertMany is a helper method to define mock.On call

  • ctx context.Context
  • documents []interface{}
  • opts ...*options.InsertManyOptions

func (*MockCollection_Expecter) InsertOne

func (_e *MockCollection_Expecter) InsertOne(ctx interface{}, document interface{}, opts ...interface{}) *MockCollection_InsertOne_Call

InsertOne is a helper method to define mock.On call

  • ctx context.Context
  • document interface{}
  • opts ...*options.InsertOneOptions

func (*MockCollection_Expecter) Name

Name is a helper method to define mock.On call

func (*MockCollection_Expecter) ReplaceOne

func (_e *MockCollection_Expecter) ReplaceOne(ctx interface{}, filter interface{}, replacement interface{}, opts ...interface{}) *MockCollection_ReplaceOne_Call

ReplaceOne is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • replacement interface{}
  • opts ...*options.ReplaceOptions

func (*MockCollection_Expecter) UpdateMany

func (_e *MockCollection_Expecter) UpdateMany(ctx interface{}, filter interface{}, update interface{}, opts ...interface{}) *MockCollection_UpdateMany_Call

UpdateMany is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • update interface{}
  • opts ...*options.UpdateOptions

func (*MockCollection_Expecter) UpdateOne

func (_e *MockCollection_Expecter) UpdateOne(ctx interface{}, filter interface{}, update interface{}, opts ...interface{}) *MockCollection_UpdateOne_Call

UpdateOne is a helper method to define mock.On call

  • ctx context.Context
  • filter interface{}
  • update interface{}
  • opts ...*options.UpdateOptions

type MockCollection_FindOneAndDelete_Call

type MockCollection_FindOneAndDelete_Call struct {
	*mock.Call
}

MockCollection_FindOneAndDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOneAndDelete'

func (*MockCollection_FindOneAndDelete_Call) Return

func (*MockCollection_FindOneAndDelete_Call) Run

func (*MockCollection_FindOneAndDelete_Call) RunAndReturn

type MockCollection_FindOneAndReplace_Call

type MockCollection_FindOneAndReplace_Call struct {
	*mock.Call
}

MockCollection_FindOneAndReplace_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOneAndReplace'

func (*MockCollection_FindOneAndReplace_Call) Return

func (*MockCollection_FindOneAndReplace_Call) Run

func (_c *MockCollection_FindOneAndReplace_Call) Run(run func(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions)) *MockCollection_FindOneAndReplace_Call

func (*MockCollection_FindOneAndReplace_Call) RunAndReturn

func (_c *MockCollection_FindOneAndReplace_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) *mongo.SingleResult) *MockCollection_FindOneAndReplace_Call

type MockCollection_FindOneAndUpdate_Call

type MockCollection_FindOneAndUpdate_Call struct {
	*mock.Call
}

MockCollection_FindOneAndUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOneAndUpdate'

func (*MockCollection_FindOneAndUpdate_Call) Return

func (*MockCollection_FindOneAndUpdate_Call) Run

func (_c *MockCollection_FindOneAndUpdate_Call) Run(run func(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions)) *MockCollection_FindOneAndUpdate_Call

func (*MockCollection_FindOneAndUpdate_Call) RunAndReturn

func (_c *MockCollection_FindOneAndUpdate_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult) *MockCollection_FindOneAndUpdate_Call

type MockCollection_FindOne_Call

type MockCollection_FindOne_Call struct {
	*mock.Call
}

MockCollection_FindOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindOne'

func (*MockCollection_FindOne_Call) Return

func (*MockCollection_FindOne_Call) Run

func (_c *MockCollection_FindOne_Call) Run(run func(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions)) *MockCollection_FindOne_Call

func (*MockCollection_FindOne_Call) RunAndReturn

func (_c *MockCollection_FindOne_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult) *MockCollection_FindOne_Call

type MockCollection_Find_Call

type MockCollection_Find_Call struct {
	*mock.Call
}

MockCollection_Find_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Find'

func (*MockCollection_Find_Call) Return

func (*MockCollection_Find_Call) Run

func (_c *MockCollection_Find_Call) Run(run func(ctx context.Context, filter interface{}, opts ...*options.FindOptions)) *MockCollection_Find_Call

func (*MockCollection_Find_Call) RunAndReturn

func (_c *MockCollection_Find_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)) *MockCollection_Find_Call

type MockCollection_Indexes_Call

type MockCollection_Indexes_Call struct {
	*mock.Call
}

MockCollection_Indexes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Indexes'

func (*MockCollection_Indexes_Call) Return

func (*MockCollection_Indexes_Call) Run

func (*MockCollection_Indexes_Call) RunAndReturn

type MockCollection_InsertMany_Call

type MockCollection_InsertMany_Call struct {
	*mock.Call
}

MockCollection_InsertMany_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertMany'

func (*MockCollection_InsertMany_Call) Return

func (*MockCollection_InsertMany_Call) Run

func (_c *MockCollection_InsertMany_Call) Run(run func(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions)) *MockCollection_InsertMany_Call

func (*MockCollection_InsertMany_Call) RunAndReturn

func (_c *MockCollection_InsertMany_Call) RunAndReturn(run func(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)) *MockCollection_InsertMany_Call

type MockCollection_InsertOne_Call

type MockCollection_InsertOne_Call struct {
	*mock.Call
}

MockCollection_InsertOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InsertOne'

func (*MockCollection_InsertOne_Call) Return

func (*MockCollection_InsertOne_Call) Run

func (_c *MockCollection_InsertOne_Call) Run(run func(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions)) *MockCollection_InsertOne_Call

func (*MockCollection_InsertOne_Call) RunAndReturn

func (_c *MockCollection_InsertOne_Call) RunAndReturn(run func(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)) *MockCollection_InsertOne_Call

type MockCollection_Name_Call

type MockCollection_Name_Call struct {
	*mock.Call
}

MockCollection_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*MockCollection_Name_Call) Return

func (*MockCollection_Name_Call) Run

func (*MockCollection_Name_Call) RunAndReturn

func (_c *MockCollection_Name_Call) RunAndReturn(run func() string) *MockCollection_Name_Call

type MockCollection_ReplaceOne_Call

type MockCollection_ReplaceOne_Call struct {
	*mock.Call
}

MockCollection_ReplaceOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReplaceOne'

func (*MockCollection_ReplaceOne_Call) Return

func (*MockCollection_ReplaceOne_Call) Run

func (_c *MockCollection_ReplaceOne_Call) Run(run func(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions)) *MockCollection_ReplaceOne_Call

func (*MockCollection_ReplaceOne_Call) RunAndReturn

func (_c *MockCollection_ReplaceOne_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)) *MockCollection_ReplaceOne_Call

type MockCollection_UpdateMany_Call

type MockCollection_UpdateMany_Call struct {
	*mock.Call
}

MockCollection_UpdateMany_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateMany'

func (*MockCollection_UpdateMany_Call) Return

func (*MockCollection_UpdateMany_Call) Run

func (_c *MockCollection_UpdateMany_Call) Run(run func(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions)) *MockCollection_UpdateMany_Call

func (*MockCollection_UpdateMany_Call) RunAndReturn

func (_c *MockCollection_UpdateMany_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)) *MockCollection_UpdateMany_Call

type MockCollection_UpdateOne_Call

type MockCollection_UpdateOne_Call struct {
	*mock.Call
}

MockCollection_UpdateOne_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOne'

func (*MockCollection_UpdateOne_Call) Return

func (*MockCollection_UpdateOne_Call) Run

func (_c *MockCollection_UpdateOne_Call) Run(run func(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions)) *MockCollection_UpdateOne_Call

func (*MockCollection_UpdateOne_Call) RunAndReturn

func (_c *MockCollection_UpdateOne_Call) RunAndReturn(run func(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)) *MockCollection_UpdateOne_Call

type MockSession

type MockSession struct {
	mock.Mock
}

MockSession is an autogenerated mock type for the Session type

func NewMockSession

func NewMockSession(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockSession

NewMockSession creates a new instance of MockSession. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockSession) AbortTransaction

func (_mock *MockSession) AbortTransaction(ctx context.Context) error

AbortTransaction provides a mock function for the type MockSession

func (*MockSession) AdvanceClusterTime

func (_mock *MockSession) AdvanceClusterTime(raw bson.Raw) error

AdvanceClusterTime provides a mock function for the type MockSession

func (*MockSession) AdvanceOperationTime

func (_mock *MockSession) AdvanceOperationTime(timestamp *primitive.Timestamp) error

AdvanceOperationTime provides a mock function for the type MockSession

func (*MockSession) Client

func (_mock *MockSession) Client() *mongo.Client

Client provides a mock function for the type MockSession

func (*MockSession) ClusterTime

func (_mock *MockSession) ClusterTime() bson.Raw

ClusterTime provides a mock function for the type MockSession

func (*MockSession) CommitTransaction

func (_mock *MockSession) CommitTransaction(ctx context.Context) error

CommitTransaction provides a mock function for the type MockSession

func (*MockSession) EXPECT

func (_m *MockSession) EXPECT() *MockSession_Expecter

func (*MockSession) EndSession

func (_mock *MockSession) EndSession(ctx context.Context)

EndSession provides a mock function for the type MockSession

func (*MockSession) ID

func (_mock *MockSession) ID() bson.Raw

ID provides a mock function for the type MockSession

func (*MockSession) OperationTime

func (_mock *MockSession) OperationTime() *primitive.Timestamp

OperationTime provides a mock function for the type MockSession

func (*MockSession) StartTransaction

func (_mock *MockSession) StartTransaction(opts ...*options.TransactionOptions) error

StartTransaction provides a mock function for the type MockSession

func (*MockSession) WithTransaction

func (_mock *MockSession) WithTransaction(ctx context.Context, fn func(ctx mongo.SessionContext) (interface{}, error), opts ...*options.TransactionOptions) (interface{}, error)

WithTransaction provides a mock function for the type MockSession

type MockSession_AbortTransaction_Call

type MockSession_AbortTransaction_Call struct {
	*mock.Call
}

MockSession_AbortTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbortTransaction'

func (*MockSession_AbortTransaction_Call) Return

func (*MockSession_AbortTransaction_Call) Run

func (*MockSession_AbortTransaction_Call) RunAndReturn

type MockSession_AdvanceClusterTime_Call

type MockSession_AdvanceClusterTime_Call struct {
	*mock.Call
}

MockSession_AdvanceClusterTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AdvanceClusterTime'

func (*MockSession_AdvanceClusterTime_Call) Return

func (*MockSession_AdvanceClusterTime_Call) Run

func (*MockSession_AdvanceClusterTime_Call) RunAndReturn

type MockSession_AdvanceOperationTime_Call

type MockSession_AdvanceOperationTime_Call struct {
	*mock.Call
}

MockSession_AdvanceOperationTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AdvanceOperationTime'

func (*MockSession_AdvanceOperationTime_Call) Return

func (*MockSession_AdvanceOperationTime_Call) Run

func (*MockSession_AdvanceOperationTime_Call) RunAndReturn

type MockSession_Client_Call

type MockSession_Client_Call struct {
	*mock.Call
}

MockSession_Client_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Client'

func (*MockSession_Client_Call) Return

func (*MockSession_Client_Call) Run

func (_c *MockSession_Client_Call) Run(run func()) *MockSession_Client_Call

func (*MockSession_Client_Call) RunAndReturn

func (_c *MockSession_Client_Call) RunAndReturn(run func() *mongo.Client) *MockSession_Client_Call

type MockSession_ClusterTime_Call

type MockSession_ClusterTime_Call struct {
	*mock.Call
}

MockSession_ClusterTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClusterTime'

func (*MockSession_ClusterTime_Call) Return

func (*MockSession_ClusterTime_Call) Run

func (*MockSession_ClusterTime_Call) RunAndReturn

func (_c *MockSession_ClusterTime_Call) RunAndReturn(run func() bson.Raw) *MockSession_ClusterTime_Call

type MockSession_CommitTransaction_Call

type MockSession_CommitTransaction_Call struct {
	*mock.Call
}

MockSession_CommitTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CommitTransaction'

func (*MockSession_CommitTransaction_Call) Return

func (*MockSession_CommitTransaction_Call) Run

func (*MockSession_CommitTransaction_Call) RunAndReturn

type MockSession_EndSession_Call

type MockSession_EndSession_Call struct {
	*mock.Call
}

MockSession_EndSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EndSession'

func (*MockSession_EndSession_Call) Return

func (*MockSession_EndSession_Call) Run

func (*MockSession_EndSession_Call) RunAndReturn

type MockSession_Expecter

type MockSession_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockSession_Expecter) AbortTransaction

func (_e *MockSession_Expecter) AbortTransaction(ctx interface{}) *MockSession_AbortTransaction_Call

AbortTransaction is a helper method to define mock.On call

  • ctx context.Context

func (*MockSession_Expecter) AdvanceClusterTime

func (_e *MockSession_Expecter) AdvanceClusterTime(raw interface{}) *MockSession_AdvanceClusterTime_Call

AdvanceClusterTime is a helper method to define mock.On call

  • raw bson.Raw

func (*MockSession_Expecter) AdvanceOperationTime

func (_e *MockSession_Expecter) AdvanceOperationTime(timestamp interface{}) *MockSession_AdvanceOperationTime_Call

AdvanceOperationTime is a helper method to define mock.On call

  • timestamp *primitive.Timestamp

func (*MockSession_Expecter) Client

Client is a helper method to define mock.On call

func (*MockSession_Expecter) ClusterTime

ClusterTime is a helper method to define mock.On call

func (*MockSession_Expecter) CommitTransaction

func (_e *MockSession_Expecter) CommitTransaction(ctx interface{}) *MockSession_CommitTransaction_Call

CommitTransaction is a helper method to define mock.On call

  • ctx context.Context

func (*MockSession_Expecter) EndSession

func (_e *MockSession_Expecter) EndSession(ctx interface{}) *MockSession_EndSession_Call

EndSession is a helper method to define mock.On call

  • ctx context.Context

func (*MockSession_Expecter) ID

ID is a helper method to define mock.On call

func (*MockSession_Expecter) OperationTime

OperationTime is a helper method to define mock.On call

func (*MockSession_Expecter) StartTransaction

func (_e *MockSession_Expecter) StartTransaction(opts ...interface{}) *MockSession_StartTransaction_Call

StartTransaction is a helper method to define mock.On call

  • opts ...*options.TransactionOptions

func (*MockSession_Expecter) WithTransaction

func (_e *MockSession_Expecter) WithTransaction(ctx interface{}, fn interface{}, opts ...interface{}) *MockSession_WithTransaction_Call

WithTransaction is a helper method to define mock.On call

  • ctx context.Context
  • fn func(ctx mongo.SessionContext) (interface{}, error)
  • opts ...*options.TransactionOptions

type MockSession_ID_Call

type MockSession_ID_Call struct {
	*mock.Call
}

MockSession_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID'

func (*MockSession_ID_Call) Return

func (*MockSession_ID_Call) Run

func (_c *MockSession_ID_Call) Run(run func()) *MockSession_ID_Call

func (*MockSession_ID_Call) RunAndReturn

func (_c *MockSession_ID_Call) RunAndReturn(run func() bson.Raw) *MockSession_ID_Call

type MockSession_OperationTime_Call

type MockSession_OperationTime_Call struct {
	*mock.Call
}

MockSession_OperationTime_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OperationTime'

func (*MockSession_OperationTime_Call) Return

func (*MockSession_OperationTime_Call) Run

func (*MockSession_OperationTime_Call) RunAndReturn

type MockSession_StartTransaction_Call

type MockSession_StartTransaction_Call struct {
	*mock.Call
}

MockSession_StartTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartTransaction'

func (*MockSession_StartTransaction_Call) Return

func (*MockSession_StartTransaction_Call) Run

func (*MockSession_StartTransaction_Call) RunAndReturn

type MockSession_WithTransaction_Call

type MockSession_WithTransaction_Call struct {
	*mock.Call
}

MockSession_WithTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithTransaction'

func (*MockSession_WithTransaction_Call) Return

func (_c *MockSession_WithTransaction_Call) Return(ifaceVal interface{}, err error) *MockSession_WithTransaction_Call

func (*MockSession_WithTransaction_Call) Run

func (*MockSession_WithTransaction_Call) RunAndReturn

func (_c *MockSession_WithTransaction_Call) RunAndReturn(run func(ctx context.Context, fn func(ctx mongo.SessionContext) (interface{}, error), opts ...*options.TransactionOptions) (interface{}, error)) *MockSession_WithTransaction_Call

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL