mocks

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeStream

type ChangeStream struct {
	mock.Mock
}

ChangeStream is an autogenerated mock type for the ChangeStream type

func (*ChangeStream) Close

func (_m *ChangeStream) Close(ctx context.Context) error

Close provides a mock function with given fields: ctx

func (*ChangeStream) Current

func (_m *ChangeStream) Current() bson.Raw

Current provides a mock function with given fields:

func (*ChangeStream) Decode

func (_m *ChangeStream) Decode(val interface{}) error

Decode provides a mock function with given fields: val

func (*ChangeStream) Err

func (_m *ChangeStream) Err() error

Err provides a mock function with given fields:

func (*ChangeStream) ID

func (_m *ChangeStream) ID() int64

ID provides a mock function with given fields:

func (*ChangeStream) Next

func (_m *ChangeStream) Next(ctx context.Context) bool

Next provides a mock function with given fields: ctx

func (*ChangeStream) ResumeToken

func (_m *ChangeStream) ResumeToken() bson.Raw

ResumeToken provides a mock function with given fields:

func (*ChangeStream) TryNext

func (_m *ChangeStream) TryNext(ctx context.Context) bool

TryNext provides a mock function with given fields: ctx

type Client

type Client struct {
	mock.Mock
}

Client is an autogenerated mock type for the Client type

func (*Client) Connect

func (_m *Client) Connect(ctx context.Context) error

Connect provides a mock function with given fields: ctx

func (*Client) Database

func (_m *Client) Database(name string, opts ...*options.DatabaseOptions) mongoifc.Database

Database provides a mock function with given fields: name, opts

func (*Client) Disconnect

func (_m *Client) Disconnect(ctx context.Context) error

Disconnect provides a mock function with given fields: ctx

func (*Client) ListDatabaseNames

func (_m *Client) ListDatabaseNames(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) ([]string, error)

ListDatabaseNames provides a mock function with given fields: ctx, filter, opts

func (*Client) ListDatabases

func (_m *Client) ListDatabases(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) (mongo.ListDatabasesResult, error)

ListDatabases provides a mock function with given fields: ctx, filter, opts

func (*Client) NumberSessionsInProgress

func (_m *Client) NumberSessionsInProgress() int

NumberSessionsInProgress provides a mock function with given fields:

func (*Client) Ping

func (_m *Client) Ping(ctx context.Context, rp *readpref.ReadPref) error

Ping provides a mock function with given fields: ctx, rp

func (*Client) StartSession

func (_m *Client) StartSession(opts ...*options.SessionOptions) (mongoifc.Session, error)

StartSession provides a mock function with given fields: opts

func (*Client) UseSession

func (_m *Client) UseSession(ctx context.Context, fn func(mongoifc.SessionContext) error) error

UseSession provides a mock function with given fields: ctx, fn

func (*Client) UseSessionWithOptions

func (_m *Client) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(mongoifc.SessionContext) error) error

UseSessionWithOptions provides a mock function with given fields: ctx, opts, fn

func (*Client) Watch

func (_m *Client) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (mongoifc.ChangeStream, error)

Watch provides a mock function with given fields: ctx, pipeline, opts

type Collection

type Collection struct {
	mock.Mock
}

Collection is an autogenerated mock type for the Collection type

func (*Collection) Aggregate

func (_m *Collection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (mongoifc.Cursor, error)

Aggregate provides a mock function with given fields: ctx, pipeline, opts

func (*Collection) BulkWrite

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

BulkWrite provides a mock function with given fields: ctx, models, opts

func (*Collection) Clone

Clone provides a mock function with given fields: opts

func (*Collection) CountDocuments

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

CountDocuments provides a mock function with given fields: ctx, filter, opts

func (*Collection) Database

func (_m *Collection) Database() mongoifc.Database

Database provides a mock function with given fields:

func (*Collection) DeleteMany

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

DeleteMany provides a mock function with given fields: ctx, filter, opts

func (*Collection) DeleteOne

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

DeleteOne provides a mock function with given fields: ctx, filter, opts

func (*Collection) Distinct

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

Distinct provides a mock function with given fields: ctx, fieldName, filter, opts

func (*Collection) Drop

func (_m *Collection) Drop(ctx context.Context) error

Drop provides a mock function with given fields: ctx

func (*Collection) EstimatedDocumentCount

func (_m *Collection) EstimatedDocumentCount(ctx context.Context, opts ...*options.EstimatedDocumentCountOptions) (int64, error)

EstimatedDocumentCount provides a mock function with given fields: ctx, opts

func (*Collection) Find

func (_m *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (mongoifc.Cursor, error)

Find provides a mock function with given fields: ctx, filter, opts

func (*Collection) FindOne

func (_m *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) mongoifc.SingleResult

FindOne provides a mock function with given fields: ctx, filter, opts

func (*Collection) FindOneAndDelete

func (_m *Collection) FindOneAndDelete(ctx context.Context, filter interface{}, opts ...*options.FindOneAndDeleteOptions) mongoifc.SingleResult

FindOneAndDelete provides a mock function with given fields: ctx, filter, opts

func (*Collection) FindOneAndReplace

func (_m *Collection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) mongoifc.SingleResult

FindOneAndReplace provides a mock function with given fields: ctx, filter, replacement, opts

func (*Collection) FindOneAndUpdate

func (_m *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) mongoifc.SingleResult

FindOneAndUpdate provides a mock function with given fields: ctx, filter, update, opts

func (*Collection) Indexes

func (_m *Collection) Indexes() mongoifc.IndexView

Indexes provides a mock function with given fields:

func (*Collection) InsertMany

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

InsertMany provides a mock function with given fields: ctx, documents, opts

func (*Collection) InsertOne

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

InsertOne provides a mock function with given fields: ctx, document, opts

func (*Collection) Name

func (_m *Collection) Name() string

Name provides a mock function with given fields:

func (*Collection) ReplaceOne

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

ReplaceOne provides a mock function with given fields: ctx, filter, replacement, opts

func (*Collection) UpdateByID

func (_m *Collection) UpdateByID(ctx context.Context, id interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

UpdateByID provides a mock function with given fields: ctx, id, update, opts

func (*Collection) UpdateMany

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

UpdateMany provides a mock function with given fields: ctx, filter, update, opts

func (*Collection) UpdateOne

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

UpdateOne provides a mock function with given fields: ctx, filter, update, opts

func (*Collection) Watch

func (_m *Collection) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (mongoifc.ChangeStream, error)

Watch provides a mock function with given fields: ctx, pipeline, opts

type Cursor

type Cursor struct {
	mock.Mock
}

Cursor is an autogenerated mock type for the Cursor type

func (*Cursor) All

func (_m *Cursor) All(ctx context.Context, results interface{}) error

All provides a mock function with given fields: ctx, results

func (*Cursor) Close

func (_m *Cursor) Close(ctx context.Context) error

Close provides a mock function with given fields: ctx

func (*Cursor) Current

func (_m *Cursor) Current() bson.Raw

Current provides a mock function with given fields:

func (*Cursor) Decode

func (_m *Cursor) Decode(val interface{}) error

Decode provides a mock function with given fields: val

func (*Cursor) Err

func (_m *Cursor) Err() error

Err provides a mock function with given fields:

func (*Cursor) ID

func (_m *Cursor) ID() int64

ID provides a mock function with given fields:

func (*Cursor) Next

func (_m *Cursor) Next(ctx context.Context) bool

Next provides a mock function with given fields: ctx

func (*Cursor) RemainingBatchLength

func (_m *Cursor) RemainingBatchLength() int

RemainingBatchLength provides a mock function with given fields:

func (*Cursor) TryNext

func (_m *Cursor) TryNext(ctx context.Context) bool

TryNext provides a mock function with given fields: ctx

type Database

type Database struct {
	mock.Mock
}

Database is an autogenerated mock type for the Database type

func (*Database) Aggregate

func (_m *Database) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (mongoifc.Cursor, error)

Aggregate provides a mock function with given fields: ctx, pipeline, opts

func (*Database) Client

func (_m *Database) Client() mongoifc.Client

Client provides a mock function with given fields:

func (*Database) Collection

func (_m *Database) Collection(name string, opts ...*options.CollectionOptions) mongoifc.Collection

Collection provides a mock function with given fields: name, opts

func (*Database) CreateCollection

func (_m *Database) CreateCollection(ctx context.Context, name string, opts ...*options.CreateCollectionOptions) error

CreateCollection provides a mock function with given fields: ctx, name, opts

func (*Database) CreateView

func (_m *Database) CreateView(ctx context.Context, viewName string, viewOn string, pipeline interface{}, opts ...*options.CreateViewOptions) error

CreateView provides a mock function with given fields: ctx, viewName, viewOn, pipeline, opts

func (*Database) Drop

func (_m *Database) Drop(ctx context.Context) error

Drop provides a mock function with given fields: ctx

func (*Database) ListCollectionNames

func (_m *Database) ListCollectionNames(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) ([]string, error)

ListCollectionNames provides a mock function with given fields: ctx, filter, opts

func (*Database) ListCollectionSpecifications

func (_m *Database) ListCollectionSpecifications(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) ([]*mongo.CollectionSpecification, error)

ListCollectionSpecifications provides a mock function with given fields: ctx, filter, opts

func (*Database) ListCollections

func (_m *Database) ListCollections(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) (mongoifc.Cursor, error)

ListCollections provides a mock function with given fields: ctx, filter, opts

func (*Database) Name

func (_m *Database) Name() string

Name provides a mock function with given fields:

func (*Database) ReadConcern

func (_m *Database) ReadConcern() *readconcern.ReadConcern

ReadConcern provides a mock function with given fields:

func (*Database) ReadPreference

func (_m *Database) ReadPreference() *readpref.ReadPref

ReadPreference provides a mock function with given fields:

func (*Database) RunCommand

func (_m *Database) RunCommand(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) mongoifc.SingleResult

RunCommand provides a mock function with given fields: ctx, runCommand, opts

func (*Database) RunCommandCursor

func (_m *Database) RunCommandCursor(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (mongoifc.Cursor, error)

RunCommandCursor provides a mock function with given fields: ctx, runCommand, opts

func (*Database) Watch

func (_m *Database) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (mongoifc.ChangeStream, error)

Watch provides a mock function with given fields: ctx, pipeline, opts

func (*Database) WriteConcern

func (_m *Database) WriteConcern() *writeconcern.WriteConcern

WriteConcern provides a mock function with given fields:

type IndexView

type IndexView struct {
	mock.Mock
}

IndexView is an autogenerated mock type for the IndexView type

func (*IndexView) CreateMany

func (_m *IndexView) CreateMany(ctx context.Context, models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error)

CreateMany provides a mock function with given fields: ctx, models, opts

func (*IndexView) CreateOne

func (_m *IndexView) CreateOne(ctx context.Context, model mongo.IndexModel, opts ...*options.CreateIndexesOptions) (string, error)

CreateOne provides a mock function with given fields: ctx, model, opts

func (*IndexView) DropAll

func (_m *IndexView) DropAll(ctx context.Context, opts ...*options.DropIndexesOptions) (bson.Raw, error)

DropAll provides a mock function with given fields: ctx, opts

func (*IndexView) DropOne

func (_m *IndexView) DropOne(ctx context.Context, name string, opts ...*options.DropIndexesOptions) (bson.Raw, error)

DropOne provides a mock function with given fields: ctx, name, opts

func (*IndexView) List

List provides a mock function with given fields: ctx, opts

func (*IndexView) ListSpecifications

func (_m *IndexView) ListSpecifications(ctx context.Context, opts ...*options.ListIndexesOptions) ([]*mongo.IndexSpecification, error)

ListSpecifications provides a mock function with given fields: ctx, opts

type Session

type Session struct {
	mock.Mock
}

Session is an autogenerated mock type for the Session type

func (*Session) AbortTransaction

func (_m *Session) AbortTransaction(ctx context.Context) error

AbortTransaction provides a mock function with given fields: ctx

func (*Session) AdvanceClusterTime

func (_m *Session) AdvanceClusterTime(_a0 bson.Raw) error

AdvanceClusterTime provides a mock function with given fields: _a0

func (*Session) AdvanceOperationTime

func (_m *Session) AdvanceOperationTime(_a0 *primitive.Timestamp) error

AdvanceOperationTime provides a mock function with given fields: _a0

func (*Session) Client

func (_m *Session) Client() mongoifc.Client

Client provides a mock function with given fields:

func (*Session) ClusterTime

func (_m *Session) ClusterTime() bson.Raw

ClusterTime provides a mock function with given fields:

func (*Session) CommitTransaction

func (_m *Session) CommitTransaction(ctx context.Context) error

CommitTransaction provides a mock function with given fields: ctx

func (*Session) EndSession

func (_m *Session) EndSession(ctx context.Context)

EndSession provides a mock function with given fields: ctx

func (*Session) ID

func (_m *Session) ID() bson.Raw

ID provides a mock function with given fields:

func (*Session) OperationTime

func (_m *Session) OperationTime() *primitive.Timestamp

OperationTime provides a mock function with given fields:

func (*Session) StartTransaction

func (_m *Session) StartTransaction(opts ...*options.TransactionOptions) error

StartTransaction provides a mock function with given fields: opts

func (*Session) WithTransaction

func (_m *Session) WithTransaction(ctx context.Context, fn func(mongoifc.SessionContext) (interface{}, error), opts ...*options.TransactionOptions) (interface{}, error)

WithTransaction provides a mock function with given fields: ctx, fn, opts

type SessionContext added in v1.0.0

type SessionContext struct {
	mock.Mock
}

SessionContext is an autogenerated mock type for the SessionContext type

func (*SessionContext) AbortTransaction added in v1.0.0

func (_m *SessionContext) AbortTransaction(ctx context.Context) error

AbortTransaction provides a mock function with given fields: ctx

func (*SessionContext) AdvanceClusterTime added in v1.0.0

func (_m *SessionContext) AdvanceClusterTime(_a0 bson.Raw) error

AdvanceClusterTime provides a mock function with given fields: _a0

func (*SessionContext) AdvanceOperationTime added in v1.0.0

func (_m *SessionContext) AdvanceOperationTime(_a0 *primitive.Timestamp) error

AdvanceOperationTime provides a mock function with given fields: _a0

func (*SessionContext) Client added in v1.0.0

func (_m *SessionContext) Client() mongoifc.Client

Client provides a mock function with given fields:

func (*SessionContext) ClusterTime added in v1.0.0

func (_m *SessionContext) ClusterTime() bson.Raw

ClusterTime provides a mock function with given fields:

func (*SessionContext) CommitTransaction added in v1.0.0

func (_m *SessionContext) CommitTransaction(ctx context.Context) error

CommitTransaction provides a mock function with given fields: ctx

func (*SessionContext) Deadline added in v1.0.0

func (_m *SessionContext) Deadline() (time.Time, bool)

Deadline provides a mock function with given fields:

func (*SessionContext) Done added in v1.0.0

func (_m *SessionContext) Done() <-chan struct{}

Done provides a mock function with given fields:

func (*SessionContext) EndSession added in v1.0.0

func (_m *SessionContext) EndSession(ctx context.Context)

EndSession provides a mock function with given fields: ctx

func (*SessionContext) Err added in v1.0.0

func (_m *SessionContext) Err() error

Err provides a mock function with given fields:

func (*SessionContext) ID added in v1.0.0

func (_m *SessionContext) ID() bson.Raw

ID provides a mock function with given fields:

func (*SessionContext) OperationTime added in v1.0.0

func (_m *SessionContext) OperationTime() *primitive.Timestamp

OperationTime provides a mock function with given fields:

func (*SessionContext) StartTransaction added in v1.0.0

func (_m *SessionContext) StartTransaction(opts ...*options.TransactionOptions) error

StartTransaction provides a mock function with given fields: opts

func (*SessionContext) Value added in v1.0.0

func (_m *SessionContext) Value(key interface{}) interface{}

Value provides a mock function with given fields: key

func (*SessionContext) WithTransaction added in v1.0.0

func (_m *SessionContext) WithTransaction(ctx context.Context, fn func(mongoifc.SessionContext) (interface{}, error), opts ...*options.TransactionOptions) (interface{}, error)

WithTransaction provides a mock function with given fields: ctx, fn, opts

type SingleResult

type SingleResult struct {
	mock.Mock
}

SingleResult is an autogenerated mock type for the SingleResult type

func (*SingleResult) Decode

func (_m *SingleResult) Decode(v interface{}) error

Decode provides a mock function with given fields: v

func (*SingleResult) DecodeBytes

func (_m *SingleResult) DecodeBytes() (bson.Raw, error)

DecodeBytes provides a mock function with given fields:

func (*SingleResult) Err

func (_m *SingleResult) Err() error

Err provides a mock function with given fields:

Jump to

Keyboard shortcuts

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