-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
83 lines (70 loc) · 1.44 KB
/
types.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package main
import (
"time"
"github.com/google/uuid"
_ "github.com/lib/pq"
"github.com/skovranek/rss_aggregator/internal/database"
)
type apiConfig struct {
DB *database.Queries
limit int32
port string
}
type UserParams struct {
Name string `json:"name"`
}
type FeedParams struct {
Name string `json:"name"`
URL string `json:"url"`
}
type FollowParams struct {
FeedID string `json:"feed_id"`
}
type User struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
Name string
ApiKey string
}
type Feed struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
Name string
Url string
UserID uuid.UUID
LastFetchedAt time.Time
}
type Follow struct {
ID uuid.UUID
FeedID uuid.UUID
UserID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
}
type Post struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
Title string
Url string
Description string
PublishedAt time.Time
FeedID uuid.UUID
}
type RSS struct {
URL string `xml:"url"`
Channel struct {
Title *string `xml:"title"`
Description *string `xml:"description"`
LastBuildDate *string `xml:"lastBuildDate"`
Items []Item `xml:"item"`
} `xml:"channel"`
}
type Item struct {
Title *string `xml:"title"`
Link string `xml:"link"`
PubDate *string `xml:"pubDate"`
Description *string `xml:"description"`
}