database

package
v0.0.0-...-e7e69c2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionAPI

type CollectionAPI interface {
	InsertOne(
		ctx context.Context,
		document interface{},
		opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

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

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

	Find(
		ctx context.Context,
		filter interface{},
		opts ...*options.FindOptions) (cur *mongo.Cursor, err error)
}

type MockCollection

type MockCollection struct {
	mock.Mock
}

func (*MockCollection) Find

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

func (*MockCollection) FindOne

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

func (*MockCollection) InsertOne

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

func (*MockCollection) UpdateByID

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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