service backend
This commit is contained in:
5
api/pkg/db/transaction/factory.go
Normal file
5
api/pkg/db/transaction/factory.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package transaction
|
||||
|
||||
type Factory interface {
|
||||
CreateTransaction() Transaction
|
||||
}
|
||||
11
api/pkg/db/transaction/transaction.go
Normal file
11
api/pkg/db/transaction/transaction.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package transaction
|
||||
|
||||
import (
|
||||
"context"
|
||||
)
|
||||
|
||||
type Callback = func(ctx context.Context) (any, error)
|
||||
|
||||
type Transaction interface {
|
||||
Execute(ctx context.Context, cb Callback) (any, error)
|
||||
}
|
||||
Reference in New Issue
Block a user