-
Notifications
You must be signed in to change notification settings - Fork 3
/
service.go
43 lines (36 loc) · 1.68 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package postmand
import "context"
// WorkerService is the interface that will be used on workers to dispatch webhooks.
type WorkerService interface {
Run(ctx context.Context)
Shutdown(ctx context.Context)
}
// MigrationService is the interface that will be used to execute database migrations.
type MigrationService interface {
Run(ctx context.Context) error
}
// WebhookService is the interface that will be used to perform operations with webhooks.
type WebhookService interface {
Get(ctx context.Context, getOptions RepositoryGetOptions) (*Webhook, error)
List(ctx context.Context, listOptions RepositoryListOptions) ([]*Webhook, error)
Create(ctx context.Context, webhook *Webhook) error
Update(ctx context.Context, webhook *Webhook) error
Delete(ctx context.Context, id ID) error
}
// DeliveryService is the interface that will be used to perform operations with deliveries.
type DeliveryService interface {
Get(ctx context.Context, getOptions RepositoryGetOptions) (*Delivery, error)
List(ctx context.Context, listOptions RepositoryListOptions) ([]*Delivery, error)
Create(ctx context.Context, delivery *Delivery) error
Update(ctx context.Context, delivery *Delivery) error
Delete(ctx context.Context, id ID) error
}
// DeliveryAttemptService is the interface that will be used to perform operations with delivery attempt.
type DeliveryAttemptService interface {
Get(ctx context.Context, getOptions RepositoryGetOptions) (*DeliveryAttempt, error)
List(ctx context.Context, listOptions RepositoryListOptions) ([]*DeliveryAttempt, error)
}
// PingService is the interface that will be used to perform ping operation against database.
type PingService interface {
Run(ctx context.Context) error
}