-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.go
54 lines (46 loc) · 1.64 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
44
45
46
47
48
49
50
51
52
53
54
package hammer
import (
"context"
)
// TopicService interface
type TopicService interface {
Find(ctx context.Context, id string) (*Topic, error)
FindAll(ctx context.Context, findOptions FindOptions) ([]*Topic, error)
Create(ctx context.Context, topic *Topic) error
Update(ctx context.Context, topic *Topic) error
Delete(ctx context.Context, id string) error
}
// SubscriptionService interface
type SubscriptionService interface {
Find(ctx context.Context, id string) (*Subscription, error)
FindAll(ctx context.Context, findOptions FindOptions) ([]*Subscription, error)
Create(ctx context.Context, subscription *Subscription) error
Update(ctx context.Context, subscription *Subscription) error
Delete(ctx context.Context, id string) error
}
// MessageService interface
type MessageService interface {
Find(ctx context.Context, id string) (*Message, error)
FindAll(ctx context.Context, findOptions FindOptions) ([]*Message, error)
Create(ctx context.Context, message *Message) error
Delete(ctx context.Context, id string) error
}
// DeliveryService interface
type DeliveryService interface {
Find(ctx context.Context, id string) (*Delivery, error)
FindAll(ctx context.Context, findOptions FindOptions) ([]*Delivery, error)
}
// DeliveryAttemptService interface
type DeliveryAttemptService interface {
Find(ctx context.Context, id string) (*DeliveryAttempt, error)
FindAll(ctx context.Context, findOptions FindOptions) ([]*DeliveryAttempt, error)
}
// WorkerService interface
type WorkerService interface {
Run(ctx context.Context)
Stop(ctx context.Context)
}
// MigrationService interface
type MigrationService interface {
Run(ctx context.Context) error
}