author | Ollivier Robert <roberto@keltia.net> |
Wed, 12 Apr 2017 14:12:40 +0200 | |
changeset 74 | ba06092b91a6 |
parent 70 | fbc089e7249d |
child 83 | adc39ae774c0 |
permissions | -rw-r--r-- |
7 | 1 |
package gondole |
2 |
||
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
3 |
import ( |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
4 |
"time" |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
5 |
) |
16
9d64e00d3ea6
Begin to fill in types.
Ollivier Robert <roberto@keltia.net>
parents:
10
diff
changeset
|
6 |
|
74
ba06092b91a6
Rename "Gondole" as "Client" to avoid "gondole.Gondole".
Ollivier Robert <roberto@keltia.net>
parents:
70
diff
changeset
|
7 |
type Client struct { |
70 | 8 |
Name string |
9 |
ID string |
|
10 |
Secret string |
|
11 |
APIBase string |
|
10 | 12 |
} |
13 |
||
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
14 |
/* |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
15 |
Entities: |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
16 |
|
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
17 |
Everything manipulated/returned by the API |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
18 |
*/ |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
19 |
|
70 | 20 |
// Account represents a Mastodon account entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
21 |
type Account struct { |
70 | 22 |
ID int `json:"id"` |
23 |
Username string `json:"username"` |
|
24 |
Acct string `json:"acct"` |
|
25 |
DisplayName string `json:"display_name"` |
|
26 |
Note string `json:"note"` |
|
27 |
URL string `json:"url"` |
|
28 |
Avatar string `json:"avatar"` |
|
29 |
Header string `json:"header"` |
|
30 |
Locked bool `json:"locked"` |
|
31 |
CreatedAt string `json:"created_at"` |
|
32 |
FollowersCount int `json:"followers_count"` |
|
33 |
FollowingCount int `json:"following_count"` |
|
34 |
StatusesCount int `json:"statuses_count"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
35 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
36 |
|
70 | 37 |
// Application represents a Mastodon application entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
38 |
type Application struct { |
70 | 39 |
Name string `json:"name"` |
40 |
Website string `json:"website"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
41 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
42 |
|
70 | 43 |
// Attachment represents a Mastodon attachement entity |
44 |
type Attachment struct { |
|
45 |
ID int `json:"iD"` |
|
46 |
Type string `json:"type"` |
|
47 |
URL string `json:"url"` |
|
48 |
RemoteURL string `json:"remote_url"` |
|
49 |
PreviewURL string `json:"preview_url"` |
|
50 |
TextURL string `json:"text_url"` |
|
10 | 51 |
} |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
52 |
|
70 | 53 |
/* |
54 |
// Card represents a Mastodon card entity |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
55 |
type Card struct { |
70 | 56 |
URL string `json:"url"` |
57 |
Title string `json:"title"` |
|
58 |
Description string `json:"description"` |
|
59 |
Image *interface{} `json:"image"` |
|
60 |
} |
|
61 |
*/ |
|
62 |
||
63 |
// Context represents a Mastodon context entity |
|
64 |
type Context struct { |
|
65 |
Ancestors []Status `json:"ancestors"` |
|
66 |
Descendents []Status `json:"descendents"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
67 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
68 |
|
70 | 69 |
// Error represents a Mastodon error entity |
70 |
type Error struct { |
|
71 |
Text string `json:"error"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
72 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
73 |
|
70 | 74 |
// Instance represents a Mastodon instance entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
75 |
type Instance struct { |
70 | 76 |
URI string `json:"uri"` |
77 |
Title string `json:"title"` |
|
78 |
Description string `json:"description"` |
|
79 |
Email string `json:"email"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
80 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
81 |
|
70 | 82 |
// Mention represents a Mastodon mention entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
83 |
type Mention struct { |
70 | 84 |
ID int `json:"id"` |
85 |
URL string `json:"url"` |
|
86 |
Username string `json:"username"` |
|
87 |
Acct string `json:"acct"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
88 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
89 |
|
70 | 90 |
// Notification represents a Mastodon notification entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
91 |
type Notification struct { |
70 | 92 |
ID int `json:"id"` |
93 |
Type string `json:"type"` |
|
94 |
CreatedAt string `json:"created_at"` |
|
95 |
Account *Account `json:"account"` |
|
96 |
Status *Status `json:"status"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
97 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
98 |
|
70 | 99 |
// Relationship represents a Mastodon relationship entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
100 |
type Relationship struct { |
70 | 101 |
Following bool `json:"following"` |
102 |
FollowedBy bool `json:"followed_by"` |
|
103 |
Blocking bool `json:"blocking"` |
|
104 |
Muting bool `json:"muting"` |
|
105 |
Requested bool `json:"requested"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
106 |
} |
70 | 107 |
|
108 |
// Report represents a Mastodon report entity |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
109 |
type Report struct { |
70 | 110 |
ID int `json:"iD"` |
111 |
ActionTaken string `json:"action_taken"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
112 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
113 |
|
70 | 114 |
// Results represents a Mastodon results entity |
115 |
type Results struct { |
|
116 |
Accounts []Account `json:"accounts"` |
|
117 |
Statuses []Status `json:"statuses"` |
|
118 |
Hashtags []string `json:"hashtags"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
119 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
120 |
|
70 | 121 |
// Status represents a Mastodon status entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
122 |
type Status struct { |
70 | 123 |
ID int `json:"id"` |
124 |
URI string `json:"uri"` |
|
125 |
URL string `json:"url"` |
|
126 |
Account *Account `json:"account"` |
|
127 |
InReplyToID int `json:"in_reply_to_id"` |
|
128 |
InReplyToAccountID int `json:"in_reply_to_account_id"` |
|
129 |
Reblog *Status `json:"reblog"` |
|
130 |
Content string `json:"content"` |
|
131 |
CreatedAt time.Time `json:"created_at"` |
|
132 |
ReblogsCount int `json:"reblogs_count"` |
|
133 |
FavouritesCount int `json:"favourites_count"` |
|
134 |
Reblogged bool `json:"reblogged"` |
|
135 |
Favourited bool `json:"favourited"` |
|
136 |
Sensitive bool `json:"sensitive"` |
|
137 |
SpoilerText string `json:"spoiler_text"` |
|
138 |
Visibility string `json:"visibility"` |
|
139 |
MediaAttachments []Attachment `json:"media_attachments"` |
|
140 |
Mentions []Mention `json:"mentions"` |
|
141 |
Tags []Tag `json:"tags"` |
|
142 |
Application Application `json:"application"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
143 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
144 |
|
70 | 145 |
// Tag represents a Mastodon tag entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
146 |
type Tag struct { |
70 | 147 |
Name string `json:"name"` |
148 |
URL string `json:"url"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
149 |
} |