-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.go
More file actions
33 lines (29 loc) · 981 Bytes
/
Copy pathtypes.go
File metadata and controls
33 lines (29 loc) · 981 Bytes
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
package types
// Article holds the metadata for an article.
type Article struct {
GUID string `json:"guid"`
Byline string `json:"byline"`
Comments []*Comment `json:"comments,omitempty"`
Headline string `json:"headline"`
URL string `json:"url"`
Timestamp int64 `json:"time"`
}
// ArticleResponse is the format of article-service responses.
type ArticleResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Data *Article `json:"data,omitempty"`
}
// Comment holds the text and metadata for an article comment.
type Comment struct {
GUID string `json:"guid"`
Article string `json:"article"`
Text string `json:"text"`
Timestamp int64 `json:"time"`
}
// CommentResponse is the format of comment-service responses.
type CommentResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Data []*Comment `json:"data,omitempty"`
}