instancev2.go (7223B)
1 // GoToSocial 2 // Copyright (C) GoToSocial Authors admin@gotosocial.org 3 // SPDX-License-Identifier: AGPL-3.0-or-later 4 // 5 // This program is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Affero General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Affero General Public License for more details. 14 // 15 // You should have received a copy of the GNU Affero General Public License 16 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 package model 19 20 // InstanceV2 models information about this instance. 21 // 22 // swagger:model instanceV2 23 type InstanceV2 struct { 24 // The domain of the instance. 25 // example: gts.example.org 26 Domain string `json:"domain"` 27 // The domain of accounts on this instance. 28 // This will not necessarily be the same as 29 // domain. 30 // example: example.org 31 AccountDomain string `json:"account_domain"` 32 // The title of the instance. 33 // example: GoToSocial Example Instance 34 Title string `json:"title"` 35 // The version of GoToSocial installed on the instance. 36 // 37 // This will contain at least a semantic version number. 38 // 39 // It may also contain, after a space, the short git commit ID of the running software. 40 // 41 // example: 0.1.1 cb85f65 42 Version string `json:"version"` 43 // The URL for the source code of the software running on this instance, in keeping with AGPL license requirements. 44 // example: https://github.com/superseriousbusiness/gotosocial 45 SourceURL string `json:"source_url"` 46 // Description of the instance. 47 // 48 // Should be HTML formatted, but might be plaintext. 49 // 50 // This should be displayed on the 'about' page for an instance. 51 Description string `json:"description"` 52 // Basic anonymous usage data for this instance. 53 Usage InstanceV2Usage `json:"usage"` 54 // An image used to represent this instance. 55 Thumbnail InstanceV2Thumbnail `json:"thumbnail"` 56 // Primary languages of the instance + moderators/admins. 57 // example: ["en"] 58 Languages []string `json:"languages"` 59 // Configured values and limits for this instance. 60 Configuration InstanceV2Configuration `json:"configuration"` 61 // Information about registering for this instance. 62 Registrations InstanceV2Registrations `json:"registrations"` 63 // Hints related to contacting a representative of the instance. 64 Contact InstanceV2Contact `json:"contact"` 65 // An itemized list of rules for this website. 66 // Currently not implemented (will always be empty array). 67 Rules []interface{} `json:"rules"` 68 } 69 70 // Usage data for this instance. 71 // 72 // swagger:model instanceV2Usage 73 type InstanceV2Usage struct { 74 Users InstanceV2Users `json:"users"` 75 } 76 77 // Usage data related to users on this instance. 78 // 79 // swagger:model instanceV2Users 80 type InstanceV2Users struct { 81 // The number of active users in the past 4 weeks. 82 // Currently not implemented: will always be 0. 83 // example: 0 84 ActiveMonth int `json:"active_month"` 85 } 86 87 // An image used to represent this instance. 88 // 89 // swagger:model instanceV2Thumbnail 90 type InstanceV2Thumbnail struct { 91 // The URL for the thumbnail image. 92 // example: https://example.org/fileserver/01BPSX2MKCRVMD4YN4D71G9CP5/attachment/original/01H88X0KQ2DFYYDSWYP93VDJZA.png 93 URL string `json:"url"` 94 // MIME type of the instance thumbnail. 95 // Key/value not set if thumbnail image type unknown. 96 // example: image/png 97 Type string `json:"thumbnail_type,omitempty"` 98 // Description of the instance thumbnail. 99 // Key/value not set if no description available. 100 // example: picture of a cute lil' friendly sloth 101 Description string `json:"thumbnail_description,omitempty"` 102 // A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet. 103 // Key/value not set if no blurhash available. 104 // example: UeKUpFxuo~R%0nW;WCnhF6RjaJt757oJodS$ 105 Blurhash string `json:"blurhash,omitempty"` 106 // Links to scaled resolution images, for high DPI screens. 107 // Key/value not set if no extra versions available. 108 Versions *InstanceV2ThumbnailVersions `json:"versions,omitempty"` 109 } 110 111 // Links to scaled resolution images, for high DPI screens. 112 // 113 // swagger:model instanceV2ThumbnailVersions 114 type InstanceV2ThumbnailVersions struct { 115 // The URL for the thumbnail image at 1x resolution. 116 // Key/value not set if scaled versions not available. 117 Size1URL string `json:"@1x,omitempty"` 118 // The URL for the thumbnail image at 2x resolution. 119 // Key/value not set if scaled versions not available. 120 Size2URL string `json:"@2x,omitempty"` 121 } 122 123 // InstanceV2URLs models instance-relevant URLs for client application consumption. 124 // 125 // swagger:model instanceV2URLs 126 type InstanceV2URLs struct { 127 // Websockets address for status and notification streaming. 128 // example: wss://example.org 129 Streaming string `json:"streaming"` 130 } 131 132 // Hints related to translation. 133 // 134 // swagger:model instanceV2ConfigurationTranslation 135 type InstanceV2ConfigurationTranslation struct { 136 // Whether the Translations API is available on this instance. 137 // Not implemented so this value is always false. 138 Enabled bool `json:"enabled"` 139 } 140 141 // Configured values and limits for this instance. 142 // 143 // swagger:model instanceV2Configuration 144 type InstanceV2Configuration struct { 145 // URLs of interest for clients apps. 146 URLs InstanceV2URLs `json:"urls"` 147 // Limits related to accounts. 148 Accounts InstanceConfigurationAccounts `json:"accounts"` 149 // Limits related to authoring statuses. 150 Statuses InstanceConfigurationStatuses `json:"statuses"` 151 // Hints for which attachments will be accepted. 152 MediaAttachments InstanceConfigurationMediaAttachments `json:"media_attachments"` 153 // Limits related to polls. 154 Polls InstanceConfigurationPolls `json:"polls"` 155 // Hints related to translation. 156 Translation InstanceV2ConfigurationTranslation `json:"translation"` 157 // Instance configuration pertaining to emojis. 158 Emojis InstanceConfigurationEmojis `json:"emojis"` 159 } 160 161 // Information about registering for this instance. 162 // 163 // swagger:model instanceV2Registrations 164 type InstanceV2Registrations struct { 165 // Whether registrations are enabled. 166 // example: false 167 Enabled bool `json:"enabled"` 168 // Whether registrations require moderator approval. 169 // example: true 170 ApprovalRequired bool `json:"approval_required"` 171 // A custom message (html string) to be shown when registrations are closed. 172 // Value will be null if no message is set. 173 // example: <p>Registrations are currently closed on example.org because of spam bots!</p> 174 Message *string `json:"message"` 175 } 176 177 // Hints related to contacting a representative of the instance. 178 // 179 // swagger:model instanceV2Contact 180 type InstanceV2Contact struct { 181 // An email address that can be messaged regarding inquiries or issues. 182 // Empty string if no email address set. 183 // example: someone@example.org 184 Email string `json:"email"` 185 // An account that can be contacted regarding inquiries or issues. 186 // Key/value not present if no contact account set. 187 Account *Account `json:"account,omitempty"` 188 }