instancev1.go (4702B)
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 // InstanceV1 models information about this instance. 21 // 22 // swagger:model instanceV1 23 type InstanceV1 struct { 24 // The URI of the instance. 25 // example: https://gts.example.org 26 URI string `json:"uri,omitempty"` 27 // The domain of accounts on this instance. 28 // This will not necessarily be the same as 29 // simply the Host part of the URI. 30 // example: example.org 31 AccountDomain string `json:"account_domain,omitempty"` 32 // The title of the instance. 33 // example: GoToSocial Example Instance 34 Title string `json:"title,omitempty"` 35 // Description of the instance. 36 // 37 // Should be HTML formatted, but might be plaintext. 38 // 39 // This should be displayed on the 'about' page for an instance. 40 Description string `json:"description"` 41 // A shorter description of the instance. 42 // 43 // Should be HTML formatted, but might be plaintext. 44 // 45 // This should be displayed on the instance splash/landing page. 46 ShortDescription string `json:"short_description"` 47 // An email address that may be used for inquiries. 48 // example: admin@example.org 49 Email string `json:"email"` 50 // The version of GoToSocial installed on the instance. 51 // 52 // This will contain at least a semantic version number. 53 // 54 // It may also contain, after a space, the short git commit ID of the running software. 55 // 56 // example: 0.1.1 cb85f65 57 Version string `json:"version"` 58 // Primary language of the instance. 59 // example: en 60 Languages []string `json:"languages"` 61 // New account registrations are enabled on this instance. 62 Registrations bool `json:"registrations"` 63 // New account registrations require admin approval. 64 ApprovalRequired bool `json:"approval_required"` 65 // Invites are enabled on this instance. 66 InvitesEnabled bool `json:"invites_enabled"` 67 // Configuration object containing values about status limits etc. 68 // This key/value will be omitted for remote instances. 69 Configuration InstanceV1Configuration `json:"configuration,omitempty"` 70 // URLs of interest for client applications. 71 URLs InstanceV1URLs `json:"urls,omitempty"` 72 // Statistics about the instance: number of posts, accounts, etc. 73 Stats map[string]int `json:"stats,omitempty"` 74 // URL of the instance avatar/banner image. 75 // example: https://example.org/files/instance/thumbnail.jpeg 76 Thumbnail string `json:"thumbnail"` 77 // MIME type of the instance thumbnail. 78 // example: image/png 79 ThumbnailType string `json:"thumbnail_type,omitempty"` 80 // Description of the instance thumbnail. 81 // example: picture of a cute lil' friendly sloth 82 ThumbnailDescription string `json:"thumbnail_description,omitempty"` 83 // Contact account for the instance. 84 ContactAccount *Account `json:"contact_account,omitempty"` 85 // Maximum allowed length of a post on this instance, in characters. 86 // 87 // This is provided for compatibility with Tusky and other apps. 88 // 89 // example: 5000 90 MaxTootChars uint `json:"max_toot_chars"` 91 } 92 93 // InstanceV1URLs models instance-relevant URLs for client application consumption. 94 // 95 // swagger:model instanceV1URLs 96 type InstanceV1URLs struct { 97 // Websockets address for status and notification streaming. 98 // example: wss://example.org 99 StreamingAPI string `json:"streaming_api"` 100 } 101 102 // InstanceV1Configuration models instance configuration parameters. 103 // 104 // swagger:model instanceV1Configuration 105 type InstanceV1Configuration struct { 106 // Instance configuration pertaining to status limits. 107 Statuses InstanceConfigurationStatuses `json:"statuses"` 108 // Instance configuration pertaining to media attachment types + size limits. 109 MediaAttachments InstanceConfigurationMediaAttachments `json:"media_attachments"` 110 // Instance configuration pertaining to poll limits. 111 Polls InstanceConfigurationPolls `json:"polls"` 112 // Instance configuration pertaining to accounts. 113 Accounts InstanceConfigurationAccounts `json:"accounts"` 114 // Instance configuration pertaining to emojis. 115 Emojis InstanceConfigurationEmojis `json:"emojis"` 116 }