This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterfaces.go
141 lines (124 loc) · 5.25 KB
/
interfaces.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 godel
// LoginResponse holds the login response from the Server
type LoginResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"`
ExpirationDate int64 `json:"expiration_date"`
DistinctID string `json:"distinct_id"`
Returning bool `json:"returning"`
}
//LatestPostsResponse ...
type LatestPostsResponse struct {
Max int64 `json:"max"`
Posts []SinglePostResponse `json:"posts"`
}
//SingleComment holds one comment of a post
type SingleComment struct {
Color string `json:"color"` // HEX Color of the post
CreatedAt string `json:"created_at"` // ISO Timestamp
Discovered int64 `json:"discovered"` // unknown
DiscoveredBy int64 `json:"discovered_by"` // unknown
Distance int64 `json:"distance"` // distance to current location
Location Location `json:"location"` //Location struct
Message string `json:"message"` // the message
ParentCreator int64 `json:"parent_creator"` // 1 if reply is from OJ else 0
PostID string `json:"post_id"` // the unique postID
PostOwn string `json:"post_own"` // own if own post else friend
UpdatedAt string `json:"updated_at"` // ISO Timestamp
UserHandle string `json:"user_handle"` // the user handle of the poster
VoteCount int64 `json:"vote_count"` // how many upvotes
}
// SinglePostResponse holds the response for one single Post
type SinglePostResponse struct {
ChildCount int64 `json:"child_count"` // count of replys
Children []SingleComment `json:"children"` // list of replys
Color string `json:"color"` // HEX Color of the post
CreatedAt string `json:"created_at"` // ISO Timestamp
Discovered int64 `json:"discovered"` // unknown
DiscoveredBy int64 `json:"discovered_by"` // unknown
Distance int64 `json:"distance"` // distance to current location
GotThanks bool `json:"got_thanks"` // bool
ImageApproved bool `json:"image_approved"` // true or false
ImageURL string `json:"image_url"` // image URL if it's an image post
Location Location `json:"location"` // Location
Message string `json:"message"` // the message
NotificationsEnabled bool `json:"notifications_enabled"` // notifications for new replys
PinCount int64 `json:"pin_count"` // how many pins
PostID string `json:"post_id"` // the unique postID
PostOwn string `json:"post_own"` // own if own post else friend
ThumbnailURL string `json:"thumbnail_url"` // url of image thumbnail
UpdatedAt string `json:"updated_at"` // ISO Timestamp
UserHandle string `json:"user_handle"` // the user handle of the poster
VoteCount int64 `json:"vote_count"` // how many upvotes
Voted string `json:"voted"` // if voted then up or down
}
// SendLocationRequest is used to set a new Location for a user
type SendLocationRequest struct {
Location Location `json:"location"` // Location struct
}
// NewPost can be used to create a new Post
type NewPost struct {
Color string `json:"color"` // HEX Color of the post
Location Location `json:"location"` // Location struct
Message string `json:"message"` // the message
}
//Coordinates hold Latitude and Longitude of the current location
type Coordinates struct {
Lat float64 `json:"lat"` // Latitude
Lng float64 `json:"lng"` // Longitude
}
//Location Holds the users current Location
type Location struct {
LocAccuracy float64 `json:"loc_accuracy"` // accuracy this is randomly generated
City string `json:"city"` // Name of the City
Country string `json:"country"` // ISO Country Code (DE for Germany)
Name string `json:"name"` // Name of the City
LocCoordinates Coordinates `json:"loc_coordinates"` // Coordinates struct
}
//LoginPayload is used to log the user in
type LoginPayload struct {
ClientID string `json:"client_id"` // the clientID this is set per jodel app version
DeviceUID string `json:"device_uid"` // the DeviceUID is used to identify the user
Location Location `json:"location"` // Location struct
}
//voteResponse ...
type voteResponse struct {
Post SinglePostResponse `json:"post"`
VoteCount int64 `json:"vote_count"`
}
//ReplyToPost is used to reply to a post
type ReplyToPost struct {
Ancestor string `json:"ancestor"` // parent post id
Color string `json:"color"` // HEX color of the post
Location Location `json:"location"` // Location
Message string `json:"message"` // the message
}
//ComboPostsResponse ...
type ComboPostsResponse struct {
Max int64 `json:"max"`
Recent []SinglePostResponse `json:"recent"` // your most recent posts
Replied []SinglePostResponse `json:"replied"` // your most replied posts
Voted []SinglePostResponse `json:"voted"` // your most voted posts
}
//Pagination ...
type Pagination struct {
Skip int64 `json:"skip"` // aka offset
Limit int64 `json:"limit"` // limit to x posts
}
//KarmaResponse holds the users Karma
type KarmaResponse struct {
Karma int64 `json:"karma"` // your karma
}
//NewAccessTokenRequest is used to request a new AccessToken
type NewAccessTokenRequest struct {
CurrentClientID string `json:"current_client_id"`
DistinctID string `json:"distinct_id"`
RefreshToken string `json:"refresh_token"`
}
//NewAccessTokenResonse is used to request a new AccessToken
type NewAccessTokenResonse struct {
AccessToken string `json:"access_token"`
ExpirationDate string `json:"expiration_date"`
}