-
Notifications
You must be signed in to change notification settings - Fork 4
/
types.go
executable file
·509 lines (481 loc) · 11.6 KB
/
types.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
// All the types/structures defined in Indigo.
package main
import (
"database/sql"
"html/template"
"sync"
"time"
)
// Variable declarations for admin settings.
type adminConfig struct {
Manage struct {
MinimumLevel int
}
Settings struct {
MinimumLevel int
}
}
type auditLogEntry struct {
ID int
Type int
TypeText string
TypeURI string
CreatorUsername string
CreatorNickname string
CreatorHasMii bool
CreatorAvatar string
CreatorFinalAva string
Context int
TargetUserAvatar string
PostSummary string
CreatedAt string
CreatedBy int
}
// Variable declarations for comments.
type comment struct {
ID int
CreatedBy int
PostID int
CreatedAt string
CreatedAtUnix int64
EditedAt string
EditedAtUnix int64
Feeling int
BodyText string
Body template.HTML
Image string
AttachmentType int
URL string
URLType int
Pinned bool
IsSpoiler bool
IsRMByAdmin bool
PostType int
CommenterUsername string
CommenterNickname string
CommenterIcon string
CommenterHasMii bool
CommenterOnline bool
CommenterHideOnline bool
CommenterColor string
CommenterRoleImage string
CommenterRoleOrganization string
Yeahed bool
YeahCount int
ByMe bool
ByMii bool
CanYeah bool
}
// Variable declarations for communities.
type community struct {
ID int
Title string
DescriptionText string
Description template.HTML
Icon string
Banner string
IsFeatured bool
Permissions int
RM bool
}
// Variable declarations for settings.
type config struct {
// if this is true, then it will listen on a unix socket instead of a tcp port
ListenSocket bool
// this can be left blank if you are listening and accessing as the same user
SocketOwner string
// if listensocket is true then port is the socket
Port string
// whether to enable gzip compression
// unnecessary with a reverse proxy, absolutely necessary without one
GzipEnabled bool
// will disable csrf protection which you probably want to do because it's annoying
CSRFProtectDisable bool
SSL struct {
Enabled bool
Certificate string
Key string
}
DB struct {
Host string
Username string
Password string
Name string
}
ImageHost struct {
Provider string
Username string
APIEndpoint string
APIPublic string
APISecret string
ImageEndpoint string
UploadPreset string
MaxUploadSize string
}
Webhooks struct {
Enabled bool
Reports string
Signups string
Logins string
}
ReCAPTCHA struct {
Enabled bool
SiteKey string
SecretKey string
}
SMTP struct {
Enabled bool
Hostname string
Port string
Email string
Password string
}
CSRFSecret string
IPHubKey string
MiiEndpointPrefix string
Proxy bool
ForceLogins bool
AllowSignups bool
DefaultTimezone string
ReportReasons []reportReason
TextToReplace []struct {
Original string
Replaced string
}
EmoteLimit int
}
// Variable declarations for conversations.
type conversation struct {
ID int
Target int
Nickname string
Username string
Online bool
HideOnline bool
Color string
Icon string
HasMii bool
RoleImage string
CreatedBy int
BodyText string
Body template.HTML
Image string
PostType int
Date string
DateUnix int64
Read bool
}
// Variable declarations for friend requests.
type friendRequest struct {
ID int
By int
CreatedAt string
CreatedAtUnix int64
Date string
Message string
Read bool
ByUsername string
ByAvatar string
ByHasMii bool
ByNickname string
ByOnline bool
ByHideOnline bool
ByColor string
ByRoleImage string
ByRoleOrganization string
}
// Variable declarations for import log entries.
type importLog struct {
ID int
Image string
Username string
}
// Variable declarations for messages.
type message struct {
ID int
Date string
DateUnix int64
Feeling int
BodyText string
Body template.HTML
Image string
AttachmentType int
URL string
URLType int
PostType int
ByUsername string
ByAvatar string
ByHasMii bool
ByOnline bool
ByHideOnline bool
ByColor string
ByRoleImage string
ByMe bool
}
// Variable declarations for migrations.
type migration struct {
Success int `json:"success"`
Error string `json:"error"`
Posts []struct {
ID interface{} `json:"id"`
CreatedBy interface{} `json:"created_by"`
CommunityID interface{} `json:"community_id"`
CreatedAt string `json:"created_at"`
EditedAt string `json:"edited_at"`
Feeling int `json:"feeling"`
Body string `json:"body"`
Image string `json:"image"`
AttachmentType int `json:"attachment_type"`
URL string `json:"url"`
IsSpoiler interface{} `json:"is_spoiler"`
IsRM int `json:"is_rm"`
IsRMByAdmin int `json:"is_rm_by_admin"`
PostType int `json:"post_type"`
} `json:"posts"`
Communities []struct {
ID interface{} `json:"id"`
Title string `json:"name"`
Icon string `json:"icon"`
} `json:"communities"`
}
// Variable declarations for the migration options.
type migrationOption struct {
ID int
Image string
PasswordRequired bool
}
// Variable declarations for notifications.
type notification struct {
ID int
Type int
By int
Post sql.NullInt64
Date string
DateUnix int64
Read bool
MergedCount int
MergedOthers int
URL string
ByUsername string
ByAvatar string
ByHasMii bool
ByNickname string
ByOnline bool
ByHideOnline bool
ByColor string
ByRoleImage string
PostText string
PostType int
PostIsRM bool
MergedUsername [3]string
MergedNickname [3]string
MergedColor [3]string
}
// Variable declarations for notification counts.
type notificationCount struct {
Messages int
Notifications int
}
// Variable declarations for poll options.
type option struct {
ID int
Name string
Votes float64
Percentage float64
Selected bool
}
// Variable declarations for polls.
type poll struct {
ID int
Votes float64
Options []option
Selected bool
}
// Variable declarations for posts.
type post struct {
ID int
Type int
CreatedBy int
CreatedAt string
CreatedAtTime time.Time
CreatedAtUnix int64
EditedAt string
EditedAtTime time.Time
EditedAtUnix int64
Feeling int
Body template.HTML
BodyText string
Image string
AttachmentType int
URL string
URLType int
Pinned bool
Privacy int
IsSpoiler bool
IsRM bool
IsRMByAdmin bool
ByMe bool
Poll poll
HasPoll bool
PostType int
Repost *post
RepostID int
MigratedID string
MigratedCommunity string
MigrationID int
MigrationImage string
MigrationURL string
PosterUsername string
PosterNickname string
PosterIcon string
PosterHasMii bool
PosterOnline bool
PosterHideOnline bool
PosterColor string
PosterRoleID int
PosterRoleImage string
PosterRoleOrganization string
CommunityID int
CommunityName string
CommunityIcon string
CommunityRM bool
Yeahed bool
CanYeah bool
YeahCount int
CommentCount int
CommentPreview comment
}
// Variable declarations for profiles.
type profile struct {
User int
CreatedAt string
CreatedAtUnix int64
NNID string
MiiHash string
AvatarImage string
AvatarID int
Gender string
Region string
Discord string
Twitter string
SwitchCode string
PSN string
YouTube string
Steam string
AllowFriend int
CommentText string
Comment template.HTML
NNIDVisibility int
YeahVisibility int
ReplyVisibility int
FavoritePostID int
FavoritePostImage string
FriendCount int
FollowingCount int
FollowerCount int
PostCount int
CommentCount int
YeahCount int
}
// Variable declarations for profile sidebars.
type profileSidebar struct {
User user
CurrentUser user
Profile profile
ProfileOnPage string
IsFollowing bool
IsFollowingMe bool
Reasons []reportReason
FavoriteCommunities []community
FriendStatus int
Request friendRequest
RequestTime string
}
// Variable declarations for reports.
type report struct {
ID int
Type int
Message string
Reason int
ByID int
ByUsername string
ByNickname string
ByColor string
Post *post
User *user
}
// Variable declarations for report reasons.
type reportReason struct {
Name string
Message string
Enabled bool
BodyRequired bool
}
// Variable declarations for repost previews.
type repostPreview struct {
ID int
Nickname string
Text string
PostType int
}
// Variable declarations for users.
type user struct {
ID int
Username string
Nickname string
Avatar string
HasMii bool
Email string
Password string
IP string
Level int
Role struct {
Image string
Organization string
}
Online bool
HideOnline bool
Color string
Theme string
ThemeColors []string
LastSeen string
LastSeenUnix int64
HideLastSeen bool
Comment string
YeahNotifications bool
LightMode bool
WebsocketsEnabled bool
DefaultPrivacy int
Blocked bool
Timezone string
Notifications notificationCount
ForbiddenKeywords string
CSRFToken string
}
// Variable declarations for websocket messages.
type wsMessage struct {
Type string `json:"type"`
ID string `json:"id"`
Content string `json:"content"`
}
// Variable declarations for websocket sessions.
type wsSession struct {
Mutex *sync.Mutex
Connected bool
UserID int
Level int
OnPage string
Send chan wsMessage
}
// Variable declarations for Yeahs.
type yeah struct {
ID int
Username string
Avatar string
HasMii bool
Role string
}
type iphubBlockResponse struct {
Block int8 `json:"block"`
ASN uint16 `json:"asn""`
}