outbox for gateways
This commit is contained in:
17
api/gateway/common/outbox/store.go
Normal file
17
api/gateway/common/outbox/store.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package outbox
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
)
|
||||
|
||||
// Store persists gateway outbox events.
|
||||
type Store interface {
|
||||
Create(ctx context.Context, event *Event) error
|
||||
ListPending(ctx context.Context, limit int) ([]*Event, error)
|
||||
MarkSent(ctx context.Context, eventRef bson.ObjectID, sentAt time.Time) error
|
||||
MarkFailed(ctx context.Context, eventRef bson.ObjectID) error
|
||||
IncrementAttempts(ctx context.Context, eventRef bson.ObjectID) error
|
||||
}
|
||||
Reference in New Issue
Block a user