fixed tests and compilation

This commit is contained in:
Stephan D
2026-02-13 02:33:22 +01:00
parent 71a7a474c8
commit 1b3aa0f9ea
8 changed files with 27 additions and 73 deletions

View File

@@ -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)