-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.go
55 lines (39 loc) · 935 Bytes
/
feed.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
55
package dq
import (
"context"
"time"
)
type Feed struct {
ID int
Name string
RssURL string
Domain string
Collections []*Collection
CreatedAt time.Time
UpdatedAt time.Time
}
type FeedService interface {
FindFeedByID(ctx context.Context, id int, include FeedInclude) (*Feed, error)
FindFeeds(ctx context.Context, filter FeedFilter, include FeedInclude) ([]*Feed, int, error)
FindFeed(ctx context.Context, filter FeedFilter, include FeedInclude) (*Feed, error)
CreateFeed(ctx context.Context, feed *Feed) (*Feed, error)
UpdateFeed(ctx context.Context, id int, upd FeedUpdate) (*Feed, error)
DeleteFeed(ctx context.Context, id int) error
}
type FeedFilter struct {
ID *int
Name *string
RssURL *string
Domain *string
CollectionID *int
Offset int
Limit int
}
type FeedUpdate struct {
Name *string
RssURL *string
Domain *string
}
type FeedInclude struct {
Collections bool
}