-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.go
141 lines (132 loc) · 4.94 KB
/
structs.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package ninegago
// loginResponse describes login API response
type loginResponse struct {
Meta MetaData `json:"meta"`
Data LoginData `json:"data"`
}
// postListResponse describes post list API response
type postListResponse struct {
Meta MetaData `json:"meta"`
Data PostListData `json:"data"`
}
// MetaData describes meta data from every API response
type MetaData struct {
Timestamp int64 `json:"timestamp"`
Status string `json:"status"`
SID string `json:"sid"`
}
// LoginData describes login data from LoginResponse
type LoginData struct {
DummyField string `json:"dummyField"` // always equals to "dummyValue"
MinVersion string `json:"minVersion"`
UserToken string `json:"userToken"`
TokenExpiry int64 `json:"tokenExpiry"`
SecondsTillExpiry int64 `json:"secondsTillExpiry"`
AlgoliaToken string `json:"algoliaToken"`
User UserData `json:"user"`
// CommentAuth struct
// Noti struct
}
// UserData describes user from LoginData
type UserData struct {
UserID string `json:"userID"`
AccountID string `json:"accountId"`
ProfileURL string `json:"profileUrl"`
Email string `json:"email"`
HasPassword byte `json:"hasPassword"`
LoginName string `json:"loginName"`
FullName string `json:"fullName"`
Gender string `json:"gender"`
Birthday string `json:"birthday"`
About string `json:"about"`
Website string `json:"website"`
Lang string `json:"lang"`
Location string `json:"location"`
ProfileColor string `json:"profileColor"`
IsFollowing byte `json:"isFollowing"`
SafeMode byte `json:"safeMode"`
HideUpvote string `json:"hideUpvote"`
TimezoneGMTOffset int `json:"timezoneGmtOffset"`
AvatarURLLarge string `json:"avatarUrlLarge"`
AvatarURLMedium string `json:"avatarUrlMedium"`
AvatarURLSmall string `json:"avatarUrlSmall"`
AvatarURLTiny string `json:"avatarUrlTiny"`
CanPostToFB byte `json:"canPostToFB"`
FBDisplayName string `json:"fbDisplayName"`
FBUserID string `json:"fbUserId"`
FBTimeline byte `json:"fbTimeline"`
FBPublish byte `json:"fbPublish"`
FBLikeAction byte `json:"fbLikeAction"`
FBCreateAction byte `json:"fbCreateAction"`
FBCommentAction byte `json:"fbCommentAction"`
GPlusAccountName string `json:"gplusAccountName"`
GPlusUserID string `json:"gplusUserId"`
// Permissions struct
}
// PostListData describes post list data from PostListResponse
type PostListData struct {
DummyField string `json:"dummyField"` // always equals to "dummyValue"
DidEndOfList byte `json:"didEndOfList"`
Posts []PostData `json:"posts"`
}
// PostData describes post from PostListData
type PostData struct {
ID string `json:"id"`
URL string `json:"url"`
Status string `json:"status"`
Title string `json:"title"`
Description string `json:"description"`
Type string `json:"type"`
Version byte `json:"version"`
NSFW byte `json:"nsfw"`
UpVoteCount int `json:"upVoteCount"`
DownVoteCount int `json:"downVoteCount"`
TotalVoteCount int `json:"totalVoteCount"`
ViewsCount int `json:"viewsCount"`
Score int `json:"score"`
ReportedStatus byte `json:"reportedStatus"`
CreationTs int64 `json:"creationTs"`
AlbumWebURL string `json:"albumWebUrl"`
HasImageTile byte `json:"hasImageTile"`
// PostTile struct
SortTs int `json:"sortTs"`
OrderID int `json:"orderId"`
HasLongPostCover byte `json:"hasLongPostCover"`
Images struct {
Image700 Image `json:"image700"`
Image460 Image `json:"image460"`
Image220x145 Image `json:"image220x145"`
ImageFbThumbnail Image `json:"imageFbThumbnail"`
} `json:"images"`
SourceDomain string `json:"sourceDomain"`
SourceURL string `json:"sourceUrl"`
ExternalURL string `json:"externalUrl"`
Channel string `json:"channel"`
IsVoted string `json:"isVoted"`
UserScore int `json:"userScore"`
CommentOpClientID string `json:"commentOpClientId"`
CommentOpSignature string `json:"commentOpSignature"`
// Creator struct
CommentsCount int `json:"commentsCount"`
FbShares int `json:"fbShares"`
TweetCount int `json:"tweetCount"`
Created string `json:"created"`
CommentSystem string `json:"commentSystem"`
// TopComments struct
// TargetedAdTags struct
Sections []string `json:"sections"`
Tags []Tag `json:"tags"`
}
// Image describes image data from PostData
type Image struct {
Width int `json:"width"`
Height int `json:"height"`
URL string `json:"url"`
Mask string `json:"mask"`
Placeholder string `json:"placeholder"`
}
// Tag describes tag data from PostData
type Tag struct {
Key string `json:"key"`
URL string `json:"url"`
}