author | Mikael Berthe <mikael@lilotux.net> |
Tue, 20 Mar 2018 21:52:55 +0100 | |
changeset 216 | 403ce36a94ab |
parent 211 | 12f0761e6442 |
child 219 | 98697242c4a0 |
permissions | -rw-r--r-- |
130 | 1 |
/* |
207 | 2 |
Copyright 2017-2018 Mikael Berthe |
130 | 3 |
Copyright 2017 Ollivier Robert |
4 |
||
5 |
Licensed under the MIT license. Please see the LICENSE file is this directory. |
|
6 |
*/ |
|
7 |
||
138
23d3a518d0ad
Update package name in source files
Mikael Berthe <mikael@lilotux.net>
parents:
136
diff
changeset
|
8 |
package madon |
7 | 9 |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
10 |
import ( |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
11 |
"time" |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
12 |
) |
16
9d64e00d3ea6
Begin to fill in types.
Ollivier Robert <roberto@keltia.net>
parents:
10
diff
changeset
|
13 |
|
138
23d3a518d0ad
Update package name in source files
Mikael Berthe <mikael@lilotux.net>
parents:
136
diff
changeset
|
14 |
// Client contains data for a madon client application |
74
ba06092b91a6
Rename "Gondole" as "Client" to avoid "gondole.Gondole".
Ollivier Robert <roberto@keltia.net>
parents:
70
diff
changeset
|
15 |
type Client struct { |
131
68ef6504637e
Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents:
130
diff
changeset
|
16 |
Name string // Name of the client |
68ef6504637e
Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents:
130
diff
changeset
|
17 |
ID string // Application ID |
68ef6504637e
Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents:
130
diff
changeset
|
18 |
Secret string // Application secret |
68ef6504637e
Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents:
130
diff
changeset
|
19 |
APIBase string // API prefix URL |
68ef6504637e
Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents:
130
diff
changeset
|
20 |
InstanceURL string // Instance base URL |
85 | 21 |
|
131
68ef6504637e
Introduce RestoreApp(), bump library version
Mikael Berthe <mikael@lilotux.net>
parents:
130
diff
changeset
|
22 |
UserToken *UserToken // User token |
10 | 23 |
} |
24 |
||
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
25 |
/* |
138
23d3a518d0ad
Update package name in source files
Mikael Berthe <mikael@lilotux.net>
parents:
136
diff
changeset
|
26 |
Entities - Everything manipulated/returned by the API |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
27 |
*/ |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
28 |
|
187
e1b1f4a168b7
Add GetDomainBlocks, DomainBlock and DomainUnblock
Mikael Berthe <mikael@lilotux.net>
parents:
186
diff
changeset
|
29 |
// DomainName is a domain name string, as returned by the domain_blocks API |
e1b1f4a168b7
Add GetDomainBlocks, DomainBlock and DomainUnblock
Mikael Berthe <mikael@lilotux.net>
parents:
186
diff
changeset
|
30 |
type DomainName string |
e1b1f4a168b7
Add GetDomainBlocks, DomainBlock and DomainUnblock
Mikael Berthe <mikael@lilotux.net>
parents:
186
diff
changeset
|
31 |
|
211
12f0761e6442
Add new type InstancePeer
Mikael Berthe <mikael@lilotux.net>
parents:
207
diff
changeset
|
32 |
// InstancePeer is a peer name, as returned by the instance/peers API |
12f0761e6442
Add new type InstancePeer
Mikael Berthe <mikael@lilotux.net>
parents:
207
diff
changeset
|
33 |
type InstancePeer string |
12f0761e6442
Add new type InstancePeer
Mikael Berthe <mikael@lilotux.net>
parents:
207
diff
changeset
|
34 |
|
70 | 35 |
// Account represents a Mastodon account entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
36 |
type Account struct { |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
37 |
ID int64 `json:"id,string"` |
136
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
38 |
Username string `json:"username"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
39 |
Acct string `json:"acct"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
40 |
DisplayName string `json:"display_name"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
41 |
Note string `json:"note"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
42 |
URL string `json:"url"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
43 |
Avatar string `json:"avatar"` |
182 | 44 |
AvatarStatic string `json:"avatar_static"` |
45 |
HeaderStatic string `json:"header_static"` |
|
136
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
46 |
Locked bool `json:"locked"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
47 |
CreatedAt time.Time `json:"created_at"` |
159
408aa794d9bb
s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents:
147
diff
changeset
|
48 |
FollowersCount int64 `json:"followers_count"` |
408aa794d9bb
s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents:
147
diff
changeset
|
49 |
FollowingCount int64 `json:"following_count"` |
408aa794d9bb
s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents:
147
diff
changeset
|
50 |
StatusesCount int64 `json:"statuses_count"` |
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
51 |
Source *struct { // Used for verify_credentials |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
52 |
Privacy string `json:"privacy"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
53 |
Sensitive bool `json:"sensitive"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
54 |
Note string `json:"note"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
55 |
} `json:"source"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
56 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
57 |
|
70 | 58 |
// Application represents a Mastodon application entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
59 |
type Application struct { |
70 | 60 |
Name string `json:"name"` |
61 |
Website string `json:"website"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
62 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
63 |
|
70 | 64 |
// Attachment represents a Mastodon attachement entity |
65 |
type Attachment struct { |
|
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
66 |
ID int64 `json:"id,string"` |
190
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
67 |
Type string `json:"type"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
68 |
URL string `json:"url"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
69 |
RemoteURL *string `json:"remote_url"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
70 |
PreviewURL string `json:"preview_url"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
71 |
TextURL *string `json:"text_url"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
72 |
Meta *struct { |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
73 |
Original struct { |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
74 |
Size string `json:"size"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
75 |
Aspect float64 `json:"aspect"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
76 |
Width int `json:"width"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
77 |
Height int `json:"height"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
78 |
} `json:"original"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
79 |
Small struct { |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
80 |
Size string `json:"size"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
81 |
Aspect float64 `json:"aspect"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
82 |
Width int `json:"width"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
83 |
Height int `json:"height"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
84 |
} `json:"small"` |
0684ddad598c
Precise Attachment meta fields
Mikael Berthe <mikael@lilotux.net>
parents:
187
diff
changeset
|
85 |
} `json:"meta"` |
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
86 |
Description *string `json:"description"` |
10 | 87 |
} |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
88 |
|
70 | 89 |
// Card represents a Mastodon card entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
90 |
type Card struct { |
186
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
91 |
URL string `json:"url"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
92 |
Title string `json:"title"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
93 |
Description string `json:"description"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
94 |
Image string `json:"image"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
95 |
Type *string `json:"type"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
96 |
AuthorName *string `json:"author_name"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
97 |
AuthorURL *string `json:"author_url"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
98 |
ProviderName *string `json:"provider_name"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
99 |
ProviderURL *string `json:"provider_url"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
100 |
HTML *string `json:"html"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
101 |
Width *int `json:"width"` |
eb9e257ba50c
Sync types with current Mastodon documentation
Mikael Berthe <mikael@lilotux.net>
parents:
185
diff
changeset
|
102 |
Height *int `json:"height"` |
70 | 103 |
} |
104 |
||
105 |
// Context represents a Mastodon context entity |
|
106 |
type Context struct { |
|
107 |
Ancestors []Status `json:"ancestors"` |
|
175
2541f5050df3
Fix Descendants spelling
Mikael Berthe <mikael@lilotux.net>
parents:
172
diff
changeset
|
108 |
Descendants []Status `json:"descendants"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
109 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
110 |
|
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
111 |
// Emoji represents a Mastodon emoji entity |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
112 |
type Emoji struct { |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
113 |
ShortCode string `json:"shortcode"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
114 |
URL string `json:"url"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
115 |
StaticURL string `json:"static_url"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
116 |
VisibleInPicker bool `json:"visible_in_picker"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
117 |
} |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
118 |
|
70 | 119 |
// Error represents a Mastodon error entity |
120 |
type Error struct { |
|
121 |
Text string `json:"error"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
122 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
123 |
|
70 | 124 |
// Instance represents a Mastodon instance entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
125 |
type Instance struct { |
70 | 126 |
URI string `json:"uri"` |
127 |
Title string `json:"title"` |
|
128 |
Description string `json:"description"` |
|
129 |
Email string `json:"email"` |
|
147
b682706e2f31
Add version filed (Mastodon 1.3+) to the Instance type
Mikael Berthe <mikael@lilotux.net>
parents:
138
diff
changeset
|
130 |
Version string `json:"version"` |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
131 |
|
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
132 |
URLs struct { |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
133 |
SteamingAPI string `json:"streaming_api"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
134 |
} `json:"urls"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
135 |
Stats struct { |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
136 |
UserCount int64 `json:"user_count"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
137 |
StatusCount int64 `json:"status_count"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
138 |
DomainCount int64 `json:"domain_count"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
139 |
} `json:"stats"` |
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
140 |
Thumbnail *string `json:"thumbnail"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
141 |
Languages []string `json:"languages"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
142 |
ContactAccount *Account `json:"contact_account"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
143 |
} |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
144 |
|
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
145 |
// List represents a Mastodon list entity |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
146 |
type List struct { |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
147 |
ID int64 `json:"id,string"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
148 |
Title string `json:"title"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
149 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
150 |
|
70 | 151 |
// Mention represents a Mastodon mention entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
152 |
type Mention struct { |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
153 |
ID int64 `json:"id,string"` |
70 | 154 |
URL string `json:"url"` |
155 |
Username string `json:"username"` |
|
156 |
Acct string `json:"acct"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
157 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
158 |
|
70 | 159 |
// Notification represents a Mastodon notification entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
160 |
type Notification struct { |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
161 |
ID int64 `json:"id,string"` |
136
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
162 |
Type string `json:"type"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
163 |
CreatedAt time.Time `json:"created_at"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
164 |
Account *Account `json:"account"` |
1af0a6199a93
Change CreatedAt fields to time.Time
Mikael Berthe <mikael@lilotux.net>
parents:
133
diff
changeset
|
165 |
Status *Status `json:"status"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
166 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
167 |
|
70 | 168 |
// Relationship represents a Mastodon relationship entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
169 |
type Relationship struct { |
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
170 |
ID int64 `json:"id,string"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
171 |
Following bool `json:"following"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
172 |
FollowedBy bool `json:"followed_by"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
173 |
Blocking bool `json:"blocking"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
174 |
Muting bool `json:"muting"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
175 |
Requested bool `json:"requested"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
176 |
DomainBlocking bool `jsin:"domain_blocking"` |
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
177 |
MutingNotifications bool `json:"muting_notifications"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
178 |
} |
70 | 179 |
|
180 |
// Report represents a Mastodon report entity |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
181 |
type Report struct { |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
182 |
ID int64 `json:"id,string"` |
70 | 183 |
ActionTaken string `json:"action_taken"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
184 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
185 |
|
70 | 186 |
// Results represents a Mastodon results entity |
187 |
type Results struct { |
|
188 |
Accounts []Account `json:"accounts"` |
|
189 |
Statuses []Status `json:"statuses"` |
|
190 |
Hashtags []string `json:"hashtags"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
191 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
192 |
|
70 | 193 |
// Status represents a Mastodon status entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
194 |
type Status struct { |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
195 |
ID int64 `json:"id,string"` |
70 | 196 |
URI string `json:"uri"` |
197 |
URL string `json:"url"` |
|
198 |
Account *Account `json:"account"` |
|
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
199 |
InReplyToID *int64 `json:"in_reply_to_id,string"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
200 |
InReplyToAccountID *int64 `json:"in_reply_to_account_id,string"` |
70 | 201 |
Reblog *Status `json:"reblog"` |
202 |
Content string `json:"content"` |
|
203 |
CreatedAt time.Time `json:"created_at"` |
|
159
408aa794d9bb
s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents:
147
diff
changeset
|
204 |
ReblogsCount int64 `json:"reblogs_count"` |
408aa794d9bb
s/int/int64/ for IDs and time integers
Mikael Berthe <mikael@lilotux.net>
parents:
147
diff
changeset
|
205 |
FavouritesCount int64 `json:"favourites_count"` |
70 | 206 |
Reblogged bool `json:"reblogged"` |
207 |
Favourited bool `json:"favourited"` |
|
185
faa72b9877c5
Update types (add Muted to Status entity)
Mikael Berthe <mikael@lilotux.net>
parents:
182
diff
changeset
|
208 |
Muted bool `json:"muted"` |
70 | 209 |
Sensitive bool `json:"sensitive"` |
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
210 |
Pinned bool `json:"pinned"` |
70 | 211 |
SpoilerText string `json:"spoiler_text"` |
212 |
Visibility string `json:"visibility"` |
|
213 |
MediaAttachments []Attachment `json:"media_attachments"` |
|
214 |
Mentions []Mention `json:"mentions"` |
|
215 |
Tags []Tag `json:"tags"` |
|
200
67bae6c005d9
Update types wrt current Mastodon API
Mikael Berthe <mikael@lilotux.net>
parents:
196
diff
changeset
|
216 |
Emojis []Emoji `json:"emojis"` |
196
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
217 |
Application *Application `json:"application"` |
21519d54dd4c
Update types to reflect Mastodon 2.0.0 API changes
Mikael Berthe <mikael@lilotux.net>
parents:
190
diff
changeset
|
218 |
Language *string `json:"language"` |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
219 |
} |
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
220 |
|
70 | 221 |
// Tag represents a Mastodon tag entity |
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
222 |
type Tag struct { |
70 | 223 |
Name string `json:"name"` |
224 |
URL string `json:"url"` |
|
17
9f17ef336aad
Add all types documented.
Ollivier Robert <roberto@keltia.net>
parents:
16
diff
changeset
|
225 |
} |