Documentation
¶
Index ¶
- type MockClient
- type MockCollection
- func (c MockCollection) DeleteOne(ctx context.Context, filter bson.M) (domain.MongoDelete, error)
- func (c MockCollection) Find(ctx context.Context, i interface{}) (domain.Cursor, error)
- func (c MockCollection) InsertOne(ctx context.Context, i interface{}) (domain.MongoInsert, error)
- func (c MockCollection) UpdateOne(ctx context.Context, filter bson.M, i interface{}) (domain.MongoUpdate, error)
- type MockCursor
- type MockDatabase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockClient ¶
type MockClient struct { *mongo.Client Context context.Context DatabaseFn func(name string) domain.DataLayer CtxFn func() context.Context }
MockClient ..
type MockCollection ¶
type MockCollection struct { *mongo.Collection FindFn func(ctx context.Context, i interface{}, ) (domain.Cursor, error) InsertOneFn func( ctx context.Context, i interface{}, ) (domain.MongoInsert, error) UpdateOneFn func( ctx context.Context, filter bson.M, i interface{}, ) (domain.MongoUpdate, error) DeleteOneFn func( ctx context.Context, filter bson.M, ) (domain.MongoDelete, error) }
MockCollection ..
func (MockCollection) DeleteOne ¶
func (c MockCollection) DeleteOne( ctx context.Context, filter bson.M, ) (domain.MongoDelete, error)
DeleteOne ..
func (MockCollection) InsertOne ¶
func (c MockCollection) InsertOne( ctx context.Context, i interface{}, ) (domain.MongoInsert, error)
InsertOne ..
func (MockCollection) UpdateOne ¶
func (c MockCollection) UpdateOne( ctx context.Context, filter bson.M, i interface{}, ) (domain.MongoUpdate, error)
UpdateOne ..
type MockCursor ¶
type MockCursor struct { mongo.Cursor NextFn func(ctx context.Context) bool CloseFn func(ctx context.Context) error DecodeFn func(i interface{}) error DecodeCursorFn func() (map[string]interface{}, error) }
MockCursor ..
func (MockCursor) DecodeCursor ¶
func (c MockCursor) DecodeCursor() (map[string]interface{}, error)
DecodeCursor ..
type MockDatabase ¶
MockDatabase ..
func (MockDatabase) Collection ¶
func (c MockDatabase) Collection(name string) domain.Entities
Collection ..
Click to show internal directories.
Click to hide internal directories.