-
-
Notifications
You must be signed in to change notification settings - Fork 296
/
instancev2.go
193 lines (182 loc) · 7.27 KB
/
instancev2.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
// GoToSocial
// Copyright (C) GoToSocial Authors admin@gotosocial.org
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package model
// InstanceV2 models information about this instance.
//
// swagger:model instanceV2
type InstanceV2 struct {
// The domain of the instance.
// example: gts.example.org
Domain string `json:"domain"`
// The domain of accounts on this instance.
// This will not necessarily be the same as
// domain.
// example: example.org
AccountDomain string `json:"account_domain"`
// The title of the instance.
// example: GoToSocial Example Instance
Title string `json:"title"`
// The version of GoToSocial installed on the instance.
//
// This will contain at least a semantic version number.
//
// It may also contain, after a space, the short git commit ID of the running software.
//
// example: 0.1.1 cb85f65
Version string `json:"version"`
// The URL for the source code of the software running on this instance, in keeping with AGPL license requirements.
// example: https://github.com/superseriousbusiness/gotosocial
SourceURL string `json:"source_url"`
// Description of the instance.
//
// Should be HTML formatted, but might be plaintext.
//
// This should be displayed on the 'about' page for an instance.
Description string `json:"description"`
// Raw (unparsed) version of description.
DescriptionText string `json:"description_text,omitempty"`
// Basic anonymous usage data for this instance.
Usage InstanceV2Usage `json:"usage"`
// An image used to represent this instance.
Thumbnail InstanceV2Thumbnail `json:"thumbnail"`
// Primary languages of the instance + moderators/admins.
// example: ["en"]
Languages []string `json:"languages"`
// Configured values and limits for this instance.
Configuration InstanceV2Configuration `json:"configuration"`
// Information about registering for this instance.
Registrations InstanceV2Registrations `json:"registrations"`
// Hints related to contacting a representative of the instance.
Contact InstanceV2Contact `json:"contact"`
// An itemized list of rules for this instance.
Rules []InstanceRule `json:"rules"`
// Terms and conditions for accounts on this instance.
Terms string `json:"terms,omitempty"`
// Raw (unparsed) version of terms.
TermsText string `json:"terms_text,omitempty"`
}
// Usage data for this instance.
//
// swagger:model instanceV2Usage
type InstanceV2Usage struct {
Users InstanceV2Users `json:"users"`
}
// Usage data related to users on this instance.
//
// swagger:model instanceV2Users
type InstanceV2Users struct {
// The number of active users in the past 4 weeks.
// Currently not implemented: will always be 0.
// example: 0
ActiveMonth int `json:"active_month"`
}
// An image used to represent this instance.
//
// swagger:model instanceV2Thumbnail
type InstanceV2Thumbnail struct {
// The URL for the thumbnail image.
// example: https://example.org/fileserver/01BPSX2MKCRVMD4YN4D71G9CP5/attachment/original/01H88X0KQ2DFYYDSWYP93VDJZA.png
URL string `json:"url"`
// MIME type of the instance thumbnail.
// Key/value not set if thumbnail image type unknown.
// example: image/png
Type string `json:"thumbnail_type,omitempty"`
// Description of the instance thumbnail.
// Key/value not set if no description available.
// example: picture of a cute lil' friendly sloth
Description string `json:"thumbnail_description,omitempty"`
// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
// Key/value not set if no blurhash available.
// example: UeKUpFxuo~R%0nW;WCnhF6RjaJt757oJodS$
Blurhash string `json:"blurhash,omitempty"`
// Links to scaled resolution images, for high DPI screens.
// Key/value not set if no extra versions available.
Versions *InstanceV2ThumbnailVersions `json:"versions,omitempty"`
}
// Links to scaled resolution images, for high DPI screens.
//
// swagger:model instanceV2ThumbnailVersions
type InstanceV2ThumbnailVersions struct {
// The URL for the thumbnail image at 1x resolution.
// Key/value not set if scaled versions not available.
Size1URL string `json:"@1x,omitempty"`
// The URL for the thumbnail image at 2x resolution.
// Key/value not set if scaled versions not available.
Size2URL string `json:"@2x,omitempty"`
}
// InstanceV2URLs models instance-relevant URLs for client application consumption.
//
// swagger:model instanceV2URLs
type InstanceV2URLs struct {
// Websockets address for status and notification streaming.
// example: wss://example.org
Streaming string `json:"streaming"`
}
// Hints related to translation.
//
// swagger:model instanceV2ConfigurationTranslation
type InstanceV2ConfigurationTranslation struct {
// Whether the Translations API is available on this instance.
// Not implemented so this value is always false.
Enabled bool `json:"enabled"`
}
// Configured values and limits for this instance.
//
// swagger:model instanceV2Configuration
type InstanceV2Configuration struct {
// URLs of interest for clients apps.
URLs InstanceV2URLs `json:"urls"`
// Limits related to accounts.
Accounts InstanceConfigurationAccounts `json:"accounts"`
// Limits related to authoring statuses.
Statuses InstanceConfigurationStatuses `json:"statuses"`
// Hints for which attachments will be accepted.
MediaAttachments InstanceConfigurationMediaAttachments `json:"media_attachments"`
// Limits related to polls.
Polls InstanceConfigurationPolls `json:"polls"`
// Hints related to translation.
Translation InstanceV2ConfigurationTranslation `json:"translation"`
// Instance configuration pertaining to emojis.
Emojis InstanceConfigurationEmojis `json:"emojis"`
}
// Information about registering for this instance.
//
// swagger:model instanceV2Registrations
type InstanceV2Registrations struct {
// Whether registrations are enabled.
// example: false
Enabled bool `json:"enabled"`
// Whether registrations require moderator approval.
// example: true
ApprovalRequired bool `json:"approval_required"`
// A custom message (html string) to be shown when registrations are closed.
// Value will be null if no message is set.
// example: <p>Registrations are currently closed on example.org because of spam bots!</p>
Message *string `json:"message"`
}
// Hints related to contacting a representative of the instance.
//
// swagger:model instanceV2Contact
type InstanceV2Contact struct {
// An email address that can be messaged regarding inquiries or issues.
// Empty string if no email address set.
// example: someone@example.org
Email string `json:"email"`
// An account that can be contacted regarding inquiries or issues.
// Key/value not present if no contact account set.
Account *Account `json:"account,omitempty"`
}