/
repository.go
39 lines (34 loc) · 1.31 KB
/
repository.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
package postmand
// RepositoryGetOptions contains options used in the Get methods.
type RepositoryGetOptions struct {
Filters map[string]interface{}
}
// RepositoryListOptions contains options used in the List methods.
type RepositoryListOptions struct {
Filters map[string]interface{}
Limit int
Offset int
OrderBy string
}
// WebhookRepository is the interface that will be used to iterate with the Webhook data.
type WebhookRepository interface {
Get(getOptions *RepositoryGetOptions) (*Webhook, error)
List(listOptions *RepositoryListOptions) ([]*Webhook, error)
Create(webhook *Webhook) error
Update(webhook *Webhook) error
Delete(id ID) error
}
// DeliveryRepository is the interface that will be used to iterate with the Delivery data.
type DeliveryRepository interface {
Get(getOptions *RepositoryGetOptions) (*Delivery, error)
List(listOptions *RepositoryListOptions) ([]*Delivery, error)
Create(delivery *Delivery) error
Update(delivery *Delivery) error
Delete(id ID) error
}
// DeliveryAttemptRepository is the interface that will be used to iterate with the DeliveryAttempt data.
type DeliveryAttemptRepository interface {
Get(getOptions *RepositoryGetOptions) (*DeliveryAttempt, error)
List(listOptions *RepositoryListOptions) ([]*DeliveryAttempt, error)
Create(deliveryAttempt *DeliveryAttempt) error
}