fixed tests and compilation
This commit is contained in:
@@ -19,6 +19,7 @@ type repositoryStub struct {
|
||||
InsertFunc func(ctx context.Context, object storable.Storable, filter builder.Query) error
|
||||
InsertManyFunc func(ctx context.Context, objects []storable.Storable) error
|
||||
UpdateFunc func(ctx context.Context, object storable.Storable) error
|
||||
UpsertFunc func(ctx context.Context, object storable.Storable) error
|
||||
DeleteFunc func(ctx context.Context, id bson.ObjectID) error
|
||||
FindOneByFilterFunc func(ctx context.Context, filter builder.Query, result storable.Storable) error
|
||||
FindManyByFilterFunc func(ctx context.Context, filter builder.Query, decoder rd.DecodingFunc) error
|
||||
@@ -64,6 +65,13 @@ func (r *repositoryStub) Update(ctx context.Context, object storable.Storable) e
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *repositoryStub) Upsert(ctx context.Context, object storable.Storable) error {
|
||||
if r.UpsertFunc != nil {
|
||||
return r.UpsertFunc(ctx, object)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *repositoryStub) Delete(ctx context.Context, id bson.ObjectID) error {
|
||||
if r.DeleteFunc != nil {
|
||||
return r.DeleteFunc(ctx, id)
|
||||
|
||||
Reference in New Issue
Block a user