mongoMock

package
v0.0.0-...-80164ef Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepositoryMock

type RepositoryMock struct {
	*mocking.BaseMock
}

func GetRepository

func GetRepository() *RepositoryMock

func (*RepositoryMock) Aggregate

func (m *RepositoryMock) Aggregate(ctx context.Context, collection mongoModel.Collection, pipe mongo.Pipeline) (*mongo.Cursor, error)

func (*RepositoryMock) CollectionIndexes

func (m *RepositoryMock) CollectionIndexes(ctx context.Context, collection mongoModel.Collection) (map[string]*mongoModel.DBIndex, error)

func (*RepositoryMock) Count

func (m *RepositoryMock) Count(ctx context.Context, collection mongoModel.Collection, find interface{}, opt *options.CountOptions) (int64, error)

func (*RepositoryMock) CreateIndex

func (m *RepositoryMock) CreateIndex(ctx context.Context, index *mongoModel.DBIndex) (string, error)

func (*RepositoryMock) CreateTextIndex

func (m *RepositoryMock) CreateTextIndex(ctx context.Context, index *mongoModel.DBTextIndex) (string, error)

func (*RepositoryMock) DeleteMany

func (m *RepositoryMock) DeleteMany(ctx context.Context, collection mongoModel.Collection, filter interface{}, opt *options.DeleteOptions) (*mongo.DeleteResult, error)

func (*RepositoryMock) DeleteOne

func (m *RepositoryMock) DeleteOne(ctx context.Context, collection mongoModel.Collection, filter interface{}, opt *options.DeleteOptions) (*mongo.DeleteResult, error)

func (*RepositoryMock) Find

func (m *RepositoryMock) Find(ctx context.Context, collection mongoModel.Collection, results, find interface{}, opt *options.FindOptions) error

func (*RepositoryMock) FindOne

func (m *RepositoryMock) FindOne(ctx context.Context, collection mongoModel.Collection, resultModel, findQuery interface{}, findOptions *options.FindOneOptions) error

func (*RepositoryMock) FindOneAndUpdate

func (m *RepositoryMock) FindOneAndUpdate(ctx context.Context, collection mongoModel.Collection, resultModel, filter, updateData interface{}, opt *options.FindOneAndUpdateOptions) error

func (*RepositoryMock) Insert

func (m *RepositoryMock) Insert(ctx context.Context, collection mongoModel.Collection, data interface{}) (string, error)

func (*RepositoryMock) InsertMany

func (m *RepositoryMock) InsertMany(ctx context.Context, collection mongoModel.Collection, data []interface{}) ([]string, error)

func (*RepositoryMock) ReplaceOne

func (m *RepositoryMock) ReplaceOne(ctx context.Context, collection mongoModel.Collection, filter, data interface{}) error

func (*RepositoryMock) TryCreateIndex

func (m *RepositoryMock) TryCreateIndex(ctx context.Context, index *mongoModel.DBIndex) error

func (*RepositoryMock) UpdateMany

func (m *RepositoryMock) UpdateMany(
	ctx context.Context,
	collection mongoModel.Collection,
	filter interface{},
	data interface{},
	opts ...*options.UpdateOptions,
) (int64, error)

func (*RepositoryMock) UpdateOne

func (m *RepositoryMock) UpdateOne(ctx context.Context, collection mongoModel.Collection, filter, data interface{}, opts ...*options.UpdateOptions) (int64, error)

Jump to

Keyboard shortcuts

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