Documentation
¶
Overview ¶
Package object contains the entities returned by the Mastodon API.
Each type mirrors one entity from the Mastodon documentation -- Account, Status, Notification, and the rest -- with JSON tags that match the wire format exactly, so a value marshals straight into an API response.
These are data carriers only. They hold no behavior, and validate nothing.
Index ¶
- Constants
- type Account
- type AccountField
- type AccountSource
- type AccountWarning
- type AdminAccount
- type AdminCanonicalEmailBlock
- type AdminCohort
- type AdminDimension
- type AdminDomainAllow
- type AdminDomainBlock
- type AdminEmailDomainBlock
- type AdminIP
- type AdminIPBlock
- type AdminMeasure
- type AdminReport
- type Announcement
- type AnnouncementAccount
- type AnnouncementStatus
- type AnnualReportEvent
- type Appeal
- type Application
- type Collection
- type CollectionItem
- type CollectionWithAccounts
- type Context
- type Conversation
- type CustomEmoji
- type DomainBlock
- type Error
- type ExtendedDescription
- type FamiliarFollower
- type FamiliarFollowers
- type FeatureApproval
- type FeaturedTag
- type Filter
- type FilterKeyword
- type FilterResult
- type FilterStatus
- type GroupedNotificationsResults
- type IdentityProof
- type Instance
- type InstanceConfiguration
- type InstanceConfigurationAccounts
- type InstanceConfigurationMediaAttachments
- type InstanceConfigurationPolls
- type InstanceConfigurationStatus
- type InstanceConfigurationTranslation
- type InstanceConfigurationURLs
- type InstanceContact
- type InstanceRegistrations
- type InstanceThumbnail
- type InstanceThumbnailVersions
- type InstanceUsage
- type InstanceUsageUsers
- type Instance_Accounts_V1
- type Instance_Configuration_V1
- type Instance_Media_V1
- type Instance_Polls_V1
- type Instance_Statuses_V1
- type Instance_V1
- type List
- type Marker
- type MediaAttachment
- type NonNullSlice
- type Notification
- type NotificationFallback
- type NotificationGroup
- type NotificationPolicy
- type NotificationPolicySummary
- type NotificationRequest
- type NotificationRequestsMerged
- type NotificationsUnreadCount
- type PartialAccountWithAvatar
- type Poll
- type PollOption
- type Preferences
- type PreviewCard
- type PreviewCardAuthor
- type PrivacyPolicy
- type Quote
- type QuoteApproval
- type Reaction
- type Relationship
- type RelationshipSeveranceEvent
- type Report
- type Role
- type Rule
- type ScheduledStatus
- type Search
- type ShallowTag
- type Status
- type StatusApplication
- type StatusEdit
- type StatusMention
- type StatusSource
- type StatusTag
- type Suggestion
- type Tag
- type TagHistory
- type TermsOfService
- type Token
- type Translation
- type V1_Filter
- type WebPushSubscription
- type WebPushSubscriptionAlerts
Constants ¶
const DomainBlockSeveritySilence = "silence"
DomainBlockSeveritySilence hides users from this domain from timelines, threads, and notifications, unless you follow the user.
const DomainBlockSeveritySuspend = "suspend"
DomainBlockSeveritySuspend rejects and drops incoming messages from this domain entirely.
const ListRepliesPolicyFollowed = "followed"
ListRepliesPolicyFollowed shows replies to any followed user.
const ListRepliesPolicyList = "list"
ListRepliesPolicyList shows replies to members of the list.
const ListRepliesPolicyNone = "none"
ListRepliesPolicyNone shows replies to no one.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"` // The account id.
Username string `json:"username"` // The username of the account, not including domain.
Acct string `json:"acct"` // The Webfinger account URI. Equal to username for local users, or username@domain for remote users.
URL string `json:"url"` // The location of the user’s profile page.
DisplayName string `json:"display_name"` // The profile's display name.
Note string `json:"note"` // The profile’s bio or description.
Avatar string `json:"avatar"` // An image icon that is shown next to statuses and in the profile.
AvatarStatic string `json:"avatar_static"` // A static version of the avatar. Equal to avatar if its value is a static image; different if avatar is an animated GIF.
Header string `json:"header"` // An image banner that is shown above the profile and in profile cards.
HeaderStatic string `json:"header_static"` // A static version of the header. Equal to header if its value is a static image; different if header is an animated GIF.
Locked bool `json:"locked"` // Whether the account manually approves follow requests.
Fields NonNullSlice[AccountField] `json:"fields"` // Metadata defined by the instance.
Emojis NonNullSlice[CustomEmoji] `json:"emojis"` // Custom emoji entities to be used when rendering the profile.
Bot bool `json:"bot"` // Indicates that the account may perform automated actions, may not be monitored, or identifies as a robot.
Group bool `json:"group"` // Indicates that the account represents a Group actor.
Discoverable bool `json:"discoverable"` // Whether the account has opted into discovery features such as the profile directory.
NoIndex bool `json:"noindex"` // Whether the local user has opted out of being indexed by search engines.
Moved *Account `json:"moved,omitempty"` // Indicates that the profile is currently inactive and that its user has moved to a new account.
Suspended bool `json:"suspended,omitempty"` // An extra attribute returned only when an account is suspended.
Limited bool `json:"limited,omitempty"` // An extra attribute returned only when an account is silenced. If true, indicates that the account should be hidden behind a warning screen.
CreatedAt string `json:"created_at"` // When the account was created. (ISO 8601 Datetime)
LastStatusAt string `json:"last_status_at,omitempty"` // When the most recent status was posted. (ISO 8601 Datetime) or null if no statuses.
StatusesCount int `json:"statuses_count"` // How many statuses are attached to this account.
FollowersCount int `json:"followers_count"` // The reported followers of this profile.
FollowingCount int `json:"following_count"` // The reported follows of this profile.
// Optional values for special kinds of accounts
Source *AccountSource `json:"source,omitempty"` // An extra attribute that contains source values to be used with API methods that verify credentials and update credentials.
MuteExpiresAt string `json:"mute_expires_at,omitempty"` // When a timed mute will expire, if applicable. (ISO 8601 Datetime), or null if the mute is indefinite
FeatureApproval *FeatureApproval `json:"feature_approval,omitempty"`
}
Account represents a user of Mastodon and their associated profile. https://docs.joinmastodon.org/entities/Account/
type AccountField ¶
type AccountField struct {
Name string `json:"name"` // The key of a given field’s key-value pair.
Value string `json:"value"` // The value associated with the name key.
VerifiedAt string `json:"verified_at,omitempty"` // Timestamp of when the server verified a URL value for a rel=“me” link. NULLABLE String (ISO 8601 Datetime) if value is a verified URL. Otherwise, null.
}
AccountField represents one name/value pair from the metadata table on a profile. https://docs.joinmastodon.org/entities/Account/#Field
type AccountSource ¶
type AccountSource struct {
Note string `json:"note"` // Profile bio, in plain-text instead of in HTML.
Fields []AccountField `json:"fields"` // Metadata about the account.
Privacy string `json:"privacy"` // The default post privacy to be used for new statuses. [public | unlisted | private | direct]
Sensitive bool `json:"sensitive"` // Whether new statuses should be marked sensitive by default.
Language string `json:"language"` // The default posting language for new statuses. (ISO 639-1 language two-letter code) or empty string
FollowRequestsCount int `json:"follow_requests_count"` // The number of pending follow requests.
}
AccountSource holds the source values of a profile, as the account owner typed them, for editing. https://docs.joinmastodon.org/entities/Account/#source
type AccountWarning ¶ added in v0.6.0
type AccountWarning struct {
ID string `json:"id"`
Action string `json:"action"` // [none | disable | mark_statuses_as_sensitive | delete_statuses | sensitive | silence | suspend]
Text string `json:"text"` // The message from the moderator to the target account.
StatusIDs []string `json:"status_ids"` // Statuses this warning applies to, if any.
TargetAccount Account `json:"target_account"`
Appeal *Appeal `json:"appeal,omitempty"`
CreatedAt string `json:"created_at"` // (ISO 8601 Datetime)
}
AccountWarning represents a moderation action taken against an account and the message sent to that account. https://docs.joinmastodon.org/entities/AccountWarning/
type AdminAccount ¶
type AdminAccount struct {
}
AdminAccount represents admin-level information about an account. https://docs.joinmastodon.org/entities/Admin_Account/
type AdminCanonicalEmailBlock ¶
type AdminCanonicalEmailBlock struct {
}
AdminCanonicalEmailBlock represents a canonical email address blocked from signing up. https://docs.joinmastodon.org/entities/Admin_CanonicalEmailBlock/
type AdminCohort ¶
type AdminCohort struct {
}
AdminCohort represents a retention metric, grouping users by when they registered. https://docs.joinmastodon.org/entities/Admin_Cohort/
type AdminDimension ¶
type AdminDimension struct {
}
AdminDimension represents a qualitative measurement about the instance. https://docs.joinmastodon.org/entities/Admin_Dimension/
type AdminDomainAllow ¶
type AdminDomainAllow struct {
}
AdminDomainAllow represents a domain that is allowed to federate with this instance. https://docs.joinmastodon.org/entities/Admin_DomainAllow/
type AdminDomainBlock ¶
type AdminDomainBlock struct {
}
AdminDomainBlock represents a domain that this instance limits or blocks. https://docs.joinmastodon.org/entities/Admin_DomainBlock/
type AdminEmailDomainBlock ¶
type AdminEmailDomainBlock struct {
}
AdminEmailDomainBlock represents an email domain blocked from signing up. https://docs.joinmastodon.org/entities/Admin_EmailDomainBlock/
type AdminIP ¶
type AdminIP struct {
}
AdminIP represents an IP address associated with a user, and when it was last seen. https://docs.joinmastodon.org/entities/Admin_Ip/
type AdminIPBlock ¶
type AdminIPBlock struct {
}
AdminIPBlock represents an IP range that is prevented from signing up. https://docs.joinmastodon.org/entities/Admin_IpBlock/
type AdminMeasure ¶
type AdminMeasure struct {
}
AdminMeasure represents a quantitative measurement about the instance, over a span of time. https://docs.joinmastodon.org/entities/Admin_Measure/
type AdminReport ¶
type AdminReport struct {
ID string `json:"id"` // The ID of the report in the database.
ActionTaken bool `json:"action_taken"` // Whether an action was taken to resolve this report.
ActionTakenAt string `json:"action_taken_at"` // When an action was taken, if this report is currently resolved. (ISO 8601 Datetime)
Category string `json:"category"` // The category under which the report is classified. [spam | violation | other]
Comment string `json:"comment"` // An optional reason for reporting.
Forwarded bool `json:"forwarded"` // Whether a report was forwarded to a remote instance.
CreatedAt string `json:"created_at"` // The time the report was filed. (ISO 8601 Datetime)
UpdatedAt string `json:"updated_at"` // The time of last action on this report. (ISO 8601 Datetime)
Account AdminAccount `json:"account"` // The account which filed the report.
TargetAccount AdminAccount `json:"target_account"` // The account being reported.
AssignedAccount *AdminAccount `json:"assigned_account,omitempty"` // The account of the moderator assigned to this report.
ActionTakenByAccount *AdminAccount `json:"action_taken_by_account,omitempty"` // The account of the moderator who handled the report.
Statuses []Status `json:"statuses"` // Statuses attached to the report, for context.
Rules []Rule `json:"rules"` // Rules attached to the report, for context.
}
AdminReport represents admin-level information about a filed report. https://docs.joinmastodon.org/entities/Admin_Report/
type Announcement ¶
type Announcement struct {
ID string `json:"id"` // The ID of the announcement in the database. (cast from an integer, but not guaranteed to be a number)
Content string `json:"content"` // The text of the announcement. (HTML)
StartsAt string `json:"starts_at,omitempty"` // When the announcement will start. (ISO 8601 Datetime) or null
EndsAt string `json:"ends_at,omitempty"` // When the announcement will end. (ISO 8601 Datetime) or null
Published bool `json:"published"` // Whether the announcement is currently active.
AllDay bool `json:"all_day"` // Whether the announcement should start and end on dates only instead of datetimes. Will be false if there is no starts_at or ends_at time.
PublishedAt string `json:"published_at"` // When the announcement was published. (ISO 8601 Datetime)
UpdatedAt string `json:"updated_at"` // When the announcement was last updated. (ISO 8601 Datetime)
Read bool `json:"read,omitempty"` // Whether the announcement has been read by the current user.
Mentions []AnnouncementAccount `json:"mentions"` // Accounts mentioned in the announcement text
Statuses []AnnouncementStatus `json:"statuses"` // Statuses linked in the announcement text.
Tags []StatusTag `json:"tags"` // Tags linked in the announcement text.
Emojis []CustomEmoji `json:"emojis"` // Custom emoji used in the announcement text.
Reactions []Reaction
}
Announcement represents an announcement set by an administrator. https://docs.joinmastodon.org/entities/Announcement/
type AnnouncementAccount ¶
type AnnouncementAccount struct {
ID string `json:"id"` // The account ID of the mentioned user.
Username string `json:"username"` // The username of the mentioned user.
URL string `json:"url"` // The location of the mentioned user’s profile.
Acct string `json:"acct"` // The webfinger acct: URI of the mentioned user. Equivalent to username for local users, or username@domain for remote users.
}
AnnouncementAccount represents an account mentioned within an announcement. https://docs.joinmastodon.org/entities/Announcement/#Account
type AnnouncementStatus ¶
type AnnouncementStatus struct {
ID string `json:"id"` // The ID of an attached Status in the database.
URL string `json:"url"` // The URL of an attached Status.
}
AnnouncementStatus represents a status linked from within an announcement. https://docs.joinmastodon.org/entities/Announcement/#Status
type AnnualReportEvent ¶ added in v0.6.0
type AnnualReportEvent struct {
Year string `json:"year"`
}
AnnualReportEvent is a small reference to an annual report, attached to a NotificationGroup when its type is "annual_report". https://docs.joinmastodon.org/entities/NotificationGroup/#annual_report
type Appeal ¶ added in v0.6.0
type Appeal struct {
Text string `json:"text"` // The text of the appeal from the moderated account to the moderators.
State string `json:"state"` // [pending | approved | rejected]
}
Appeal represents an account's appeal of a moderation action (AccountWarning). https://docs.joinmastodon.org/entities/Appeal/
type Application ¶
type Application struct {
ID string `json:"id"` // The ID of your application.
Name string `json:"name"` // The name of your application.
Website string `json:"website,omitempty"` // The website associated with your application.
Scopes []string `json:"scopes,omitempty"` // The scopes for your application.
RedirectURIs []string `json:"redirect_uris,omitempty"` // The registered redirection URIs for your application.
RedirectURI string `json:"redirect_uri,omitempty"` // Deprecated: the registered redirection URIs, separated by newlines. Some clients still require it.
VapidKey string `json:"vapid_key,omitempty"` // Used for Push Streaming API. Returned with POST /api/v1/apps. Equivalent to WebPushSubscription#server_key
ClientID string `json:"client_id,omitempty"` // Client ID key, to be used for obtaining OAuth tokens
ClientSecret string `json:"client_secret,omitempty"` // Client secret key, to be used for obtaining OAuth tokens
}
Application represents an application that interfaces with the REST API to access accounts or post statuses. https://docs.joinmastodon.org/entities/Application/
type Collection ¶ added in v0.6.0
type Collection struct {
ID string `json:"id"` // The ID of the Collection in the database.
URI string `json:"uri"` // URI of the collection used for federation.
Name string `json:"name"` // The collection's display name.
Description string `json:"description"` // The collection's description.
Language string `json:"language"` // Primary language of the collection. (ISO 639 Part 1 two-letter code)
AccountID string `json:"account_id"` // The ID of the Account that owns this collection.
Local bool `json:"local"` // Is this collection local to this server?
Sensitive bool `json:"sensitive"` // Is this collection marked as sensitive?
Discoverable bool `json:"discoverable"` // Should this collection be shown in discovery surfaces?
URL string `json:"url"` // A link to the collection's HTML representation.
ItemCount int `json:"item_count"` // How many items are in this collection.
Tag ShallowTag `json:"tag"` // The hashtag associated with this collection.
Items []CollectionItem `json:"items"` // The accounts (and their consent state) in this collection.
CreatedAt string `json:"created_at"` // (ISO 8601 Datetime)
UpdatedAt string `json:"updated_at"` // (ISO 8601 Datetime)
}
Collection represents a curated, named group of accounts (e.g. a featured-tag-driven collection). https://docs.joinmastodon.org/entities/Collection/
type CollectionItem ¶ added in v0.6.0
type CollectionItem struct {
ID string `json:"id"` // The ID of the CollectionItem in the database.
State string `json:"state"` // [pending | accepted | rejected | revoked]
AccountID string `json:"account_id,omitempty"` // Only present when state is pending or accepted.
CreatedAt string `json:"created_at"` // (ISO 8601 Datetime)
}
CollectionItem represents an account's membership (and consent state) in a Collection. https://docs.joinmastodon.org/entities/CollectionItem/
type CollectionWithAccounts ¶ added in v0.6.0
type CollectionWithAccounts struct {
Collection Collection `json:"collection"`
Accounts []Account `json:"accounts"`
}
CollectionWithAccounts pairs a Collection with the full Account records of its members. https://docs.joinmastodon.org/entities/CollectionWithAccounts/
type Context ¶
type Context struct {
Ancestors []Status `json:"ancestors"` // Parents in the thread.
Descendants []Status `json:"descendants"` // Children in the thread.
}
Context represents the tree around a given status. Used for reconstructing threads of statuses. https://docs.joinmastodon.org/entities/Context/
type Conversation ¶
type Conversation struct {
ID string `json:"id"` // The ID of the conversation in the database.
Unread bool `json:"unread"` // Is the conversation currently marked as unread?
Accounts []Account `json:"accounts"` // Participants in the conversation.
LastStatus Status `json:"last_status,omitempty"` // The last status in the conversation.
}
Conversation represents a conversation with "direct message" visibility. https://docs.joinmastodon.org/entities/Conversation/
type CustomEmoji ¶
type CustomEmoji struct {
ShortCode string `json:"shortcode"` // The name of the custom emoji.
URL string `json:"url"` // A link to the custom emoji.
StaticURL string `json:"static_url"` // A link to a static copy of the custom emoji.
VisibleInPicker bool `json:"visible_in_picker"` // Whether this Emoji should be visible in the picker or unlisted.
Category string `json:"category"` // Used for sorting custom emoji in the picker.
}
CustomEmoji represents a custom emoji. https://docs.joinmastodon.org/entities/CustomEmoji/
type DomainBlock ¶
type DomainBlock struct {
Domain string `json:"domain"` // The domain which is blocked. This may be obfuscated or partially censored.
Digest string `json:"digest"` // The SHA256 hash digest of the domain string.
Severity string `json:"severity"` // The level to which the domain is blocked. [silence | suspend]
Comment string `json:"comment,omitempty"` // An optional reason for the domain block.
}
DomainBlock represents a domain that is blocked by the instance. https://docs.joinmastodon.org/entities/DomainBlock/
type Error ¶
type Error struct {
Error int `json:"error"` // The error message.
ErrorDescription string `json:"error_description"` // A longer description of the error, mainly provided with the OAuth API.
}
Error represents an error message. https://docs.joinmastodon.org/entities/Error/
type ExtendedDescription ¶
type ExtendedDescription struct {
UpdatedAt string `json:"updated_at"` // A timestamp of when the extended description was last updated. (ISO 8601 Datetime)
Content string `json:"content"` // The rendered HTML content of the extended description.
}
ExtendedDescription represents an extended description for the instance, to be shown on its about page. https://docs.joinmastodon.org/entities/ExtendedDescription/
type FamiliarFollower ¶
type FamiliarFollower struct {
ID string `json:"id"` // The ID of the Account in the database.
Accounts []Account `json:"accounts"` // Accounts you follow that also follow this account.
}
FamiliarFollower pairs an account with the people you follow who also follow it. https://docs.joinmastodon.org/entities/FamiliarFollowers/#attributes
type FamiliarFollowers ¶
type FamiliarFollowers []FamiliarFollower
FamiliarFollowers represents a subset of your follows who also follow some other user. https://docs.joinmastodon.org/entities/FamiliarFollowers/
type FeatureApproval ¶ added in v0.6.0
type FeatureApproval struct {
Automatic []string `json:"automatic"`
Manual []string `json:"manual"`
CurrentUser string `json:"current_user"`
}
FeatureApproval summarizes an account's "who can feature me in a Collection" policy. https://docs.joinmastodon.org/entities/Account/#feature_approval
type FeaturedTag ¶
type FeaturedTag struct {
ID string `json:"id"` // The internal ID of the featured tag in the database.
Name string `json:"name"` // The name of the hashtag being featured.
URL string `json:"url"` // A link to all statuses by a user that contain this hashtag.
StatusesCount int `json:"statuses_count"` // The number of authored statuses containing this hashtag.
LastStatusAt string `json:"last_status_at"` // The timestamp of the last authored status containing this hashtag. (ISO 8601 Datetime)
}
FeaturedTag represents a hashtag that is featured on a profile. https://docs.joinmastodon.org/entities/FeaturedTag/
type Filter ¶
type Filter struct {
ID string `json:"id"` // The ID of the Filter in the database.
Title string `json:"title"` // A title given by the user to name the filter.
Context NonNullSlice[string] `json:"context"` // The contexts in which the filter should be applied. [home | notifications | public | thread | account]
ExpiresAt *string `json:"expires_at"` // When the filter should no longer be applied (ISO 8601 Datetime), or null for never.
FilterAction string `json:"filter_action"` // The action to be taken when a status matches this filter. [warn | hide | blur]
Keywords NonNullSlice[FilterKeyword] `json:"keywords"` // The keywords grouped under this filter.
Statuses NonNullSlice[FilterStatus] `json:"statuses"` // The statuses grouped under this filter.
}
Filter represents a user-defined filter for determining which statuses should not be shown to the user. https://docs.joinmastodon.org/entities/Filter/
type FilterKeyword ¶
type FilterKeyword struct {
ID string `json:"id"` // The ID of the FilterKeyword in the database.
Keyword string `json:"keyword"` // The phrase to be matched against.
WholeWord bool `json:"whole_word"` // Should the filter consider word boundaries? See implementation guidelines for filters. https://docs.joinmastodon.org/api/guidelines/#filters
}
FilterKeyword represents a keyword that, if matched, should cause the filter action to be taken. https://docs.joinmastodon.org/entities/FilterKeyword/
type FilterResult ¶
type FilterResult struct {
Filter Filter `json:"filter"` // The filter that was matched.
KeywordMatches []string `json:"keyword_matches,omitempty"` // The keyword within the filter that was matched.
StatusMatches []string `json:"status_matches,omitempty"` // The status ID within the filter that was matched.
}
FilterResult represents a filter that matched a status, and the keywords that matched it. https://docs.joinmastodon.org/entities/FilterResult/
type FilterStatus ¶
type FilterStatus struct {
ID string `json:"id"` // The ID of the FilterStatus in the database.
StatusID string `json:"status_id"` // The ID of the Status that will be filtered.
}
FilterStatus represents a status ID that, if matched, should cause the filter action to be taken. https://docs.joinmastodon.org/entities/FilterStatus/
type GroupedNotificationsResults ¶ added in v0.6.0
type GroupedNotificationsResults struct {
Accounts []Account `json:"accounts"`
PartialAccounts []PartialAccountWithAvatar `json:"partial_accounts,omitempty"`
Statuses []Status `json:"statuses"`
NotificationGroups []NotificationGroup `json:"notification_groups"`
}
GroupedNotificationsResults is the response shape for the grouped notifications API. https://docs.joinmastodon.org/methods/grouped_notifications/#GroupedNotificationsResults
type IdentityProof ¶
type IdentityProof struct {
Provider string `json:"provider"` // The name of the identity provider.
ProviderUsername string `json:"provider_username"` // The account owner’s username on the identity provider’s service.
UpdatedAt string `json:"updated_at"` // When the identity proof was last updated. (ISO 8601 Datetime)
ProofURL string `json:"proof_url"` // A link to a statement of identity proof, hosted by the identity provider.
ProfileURL string `json:"profile_url"` // The account owner’s profile URL on the identity provider.
}
IdentityProof represents a proof from an external identity provider. https://docs.joinmastodon.org/entities/IdentityProof/
type Instance ¶
type Instance struct {
Domain string `json:"domain"` // The domain name of the instance.
Title string `json:"title"` // The title of the website.
Version string `json:"version"` // The version of Mastodon installed on the instance.
SourceURL string `json:"source_url"` // The URL for the source code of the software running on this instance, in keeping with AGPL license requirements.
Description string `json:"description"` // A short, plain-text description defined by the admin.
Usage InstanceUsage `json:"usage"` // Usage data for this instance.
Thumbnail InstanceThumbnail `json:"thumbnail"` // An image used to represent this instance.
Languages []string `json:"languages"` // Primary languages of the website and its staff. (ISO 639-1 two letter code)
Configuration InstanceConfiguration `json:"configuration"` // Configured values and limits for this website.
Registrations InstanceRegistrations `json:"registrations"` // Information about registering for this website.
Contact InstanceContact `json:"contact"` // Hints related to contacting a representative of the website.
Rules []Rule `json:"rules"` // An itemized list of rules for this website.
}
Instance represents the software instance of Mastodon running on this domain. https://docs.joinmastodon.org/entities/Instance/
type InstanceConfiguration ¶
type InstanceConfiguration struct {
URLs InstanceConfigurationURLs `json:"urls"` // URLs of interest for clients apps.
Accounts InstanceConfigurationAccounts `json:"accounts"`
Statuses InstanceConfigurationStatus `json:"statuses"` // Limits related to authoring statuses.
MediaAttachments InstanceConfigurationMediaAttachments `json:"media_attachments"` // Hints for which attachments will be accepted.
Polls InstanceConfigurationPolls `json:"polls"` // Limits related to polls.
Translation InstanceConfigurationTranslation `json:"translation"` // Hints related to translation.
}
InstanceConfiguration contains configured values and limits for this website. https://docs.joinmastodon.org/entities/Instance/#configuration
type InstanceConfigurationAccounts ¶
type InstanceConfigurationAccounts struct {
MaxFeaturedTags int `json:"max_featured_tags"` // The maximum number of featured tags allowed for each account.
}
InstanceConfigurationAccounts holds the limits related to accounts. https://docs.joinmastodon.org/entities/Instance/#accounts
type InstanceConfigurationMediaAttachments ¶
type InstanceConfigurationMediaAttachments struct {
SupportedMimeTypes []string `json:"supported_mime_types"` // Contains MIME types that can be uploaded.
DescriptionLimit int `json:"description_limit"` // The maximum size of a description, in characters.
ImageSizeLimit int `json:"image_size_limit"` // The maximum size of any uploaded image, in bytes.
ImageMatrixLimit int `json:"image_matrix_limit"` // The maximum number of pixels (width times height) for image uploads.
VideoSizeLimit int `json:"video_size_limit"` // The maximum size of any uploaded video, in bytes.
VideoFrameRateLimit int `json:"video_frame_rate_limit"` // The maximum frame rate for any uploaded video.
VideoMatrixLimit int `json:"video_matrix_limit"` // The maximum number of pixels (width times height) for video uploads.
}
InstanceConfigurationMediaAttachments holds hints for which attachments will be accepted. https://docs.joinmastodon.org/entities/Instance/#media_attachments
type InstanceConfigurationPolls ¶
type InstanceConfigurationPolls struct {
MaxOptions int `json:"max_options"` // Each poll is allowed to have up to this many options.
MaxCharactersPerOption int `json:"max_characters_per_option"` // Each poll option is allowed to have this many characters.
MinExpiration int `json:"min_expiration"` // The shortest allowed poll duration, in seconds.
MaxExpiration int `json:"max_expiration"` // The longest allowed poll duration, in seconds.
}
InstanceConfigurationPolls holds the limits related to polls. https://docs.joinmastodon.org/entities/Instance/#polls
type InstanceConfigurationStatus ¶
type InstanceConfigurationStatus struct {
MaxCharacters int `json:"max_characters"` // The maximum number of allowed characters per status.
MaxMediaAttachments int `json:"max_media_attachments"` // The maximum number of media attachments that can be added to a status.
CharactersReservedPerURL int `json:"characters_reserved_per_url"` // Each URL in a status will be assumed to be exactly this many characters.
}
InstanceConfigurationStatus holds the limits related to authoring statuses. https://docs.joinmastodon.org/entities/Instance/#statuses
type InstanceConfigurationTranslation ¶
type InstanceConfigurationTranslation struct {
Enabled bool `json:"enabled"` // Whether the Translations API is available on this instance.
}
InstanceConfigurationTranslation holds the hints related to translation. https://docs.joinmastodon.org/entities/Instance/#translation
type InstanceConfigurationURLs ¶
type InstanceConfigurationURLs struct {
StreamingAPI string `json:"streaming_api"` // The Websockets URL for connecting to the streaming API.
}
InstanceConfigurationURLs holds URLs of interest to client apps. https://docs.joinmastodon.org/entities/Instance/#urls
type InstanceContact ¶
type InstanceContact struct {
Email string `json:"email"` // An email address that can be messaged regarding inquiries or issues.
Account Account `json:"account"` // An account that can be contacted natively over the network regarding inquiries or issues.
}
InstanceContact holds hints related to contacting a representative of the website. https://docs.joinmastodon.org/entities/Instance/#contact
type InstanceRegistrations ¶
type InstanceRegistrations struct {
Enabled bool `json:"enabled"` // Whether registrations are enabled.
ApprovalRequired bool `json:"approval_required"` // Whether registrations require moderator approval.
Message string `json:"message,omitempty"` // A custom message to be shown when registrations are closed.
}
InstanceRegistrations holds information about registering for this website. https://docs.joinmastodon.org/entities/Instance/#registrations
type InstanceThumbnail ¶
type InstanceThumbnail struct {
URL string `json:"url"` // The URL for the thumbnail image.
Blurhash string `json:"blurhash,omitempty"` // A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
Versions InstanceThumbnailVersions `json:"versions,omitempty"` // Links to scaled resolution images, for high DPI screens.
}
InstanceThumbnail represents the image used to represent this instance. https://docs.joinmastodon.org/entities/Instance/#thumbnail
type InstanceThumbnailVersions ¶
type InstanceThumbnailVersions struct {
At1X string `json:"@1x,omitempty"` // The URL for the thumbnail image at 1x resolution.
At2X string `json:"@2x,omitempty"` // The URL for the thumbnail image at 2x resolution.
}
InstanceThumbnailVersions holds the links to an instance thumbnail at each pixel density. https://docs.joinmastodon.org/entities/Instance/#thumbnail-versions
type InstanceUsage ¶
type InstanceUsage struct {
Users InstanceUsageUsers `json:"users"` // Usage data related to users on this instance.
}
InstanceUsage holds the usage statistics for this instance. https://docs.joinmastodon.org/entities/Instance/#usage
type InstanceUsageUsers ¶
type InstanceUsageUsers struct {
ActiveMonth int `json:"active_month"` // The number of active users in the past 4 weeks.
}
InstanceUsageUsers holds the user statistics for this instance. https://docs.joinmastodon.org/entities/Instance/#active_month
type Instance_Accounts_V1 ¶ added in v0.2.0
type Instance_Accounts_V1 struct {
MaxFeaturedTags int `json:"max_featured_tags"`
}
Instance_Accounts_V1 holds the limits related to accounts, in their deprecated v1 shape.
type Instance_Configuration_V1 ¶ added in v0.2.0
type Instance_Configuration_V1 struct {
Accounts Instance_Accounts_V1 `json:"accounts"`
Statuses Instance_Statuses_V1 `json:"statuses"`
MediaAttachments Instance_Media_V1 `json:"media_attachments"`
Polls Instance_Polls_V1 `json:"polls"`
}
Instance_Configuration_V1 holds the configured values and limits, in their deprecated v1 shape.
type Instance_Media_V1 ¶ added in v0.2.0
type Instance_Media_V1 struct {
SupportedMimeTypes []string `json:"supported_mime_types"`
ImageSizeLimit int `json:"image_size_limit"`
ImageMatrixLimit int `json:"image_matrix_limit"`
VideoSizeLimit int `json:"video_size_limit"`
VideoFrameRateLimit int `json:"video_frame_rate_limit"`
VideoMatrixLimit int `json:"video_matrix_limit"`
}
Instance_Media_V1 holds the limits related to media attachments, in their deprecated v1 shape.
type Instance_Polls_V1 ¶ added in v0.2.0
type Instance_Polls_V1 struct {
MaxOptions int `json:"max_options"`
MaxCharactersPerOption int `json:"max_characters_per_option"`
MinExpiration int `json:"min_expiration"`
MaxExpiration int `json:"max_expiration"`
}
Instance_Polls_V1 holds the limits related to polls, in their deprecated v1 shape.
type Instance_Statuses_V1 ¶ added in v0.2.0
type Instance_Statuses_V1 struct {
MaxCharacters int `json:"max_characters"`
MaxMediaAttachments int `json:"max_media_attachments"`
CharactersReservedPerURL int `json:"characters_reserved_per_url"`
}
Instance_Statuses_V1 holds the limits related to statuses, in their deprecated v1 shape.
type Instance_V1 ¶ added in v0.2.0
type Instance_V1 struct {
URI string `json:"uri"`
Title string `json:"title"`
ShortDescription string `json:"short_description"`
Description string `json:"description"`
Email string `json:"email"`
Version string `json:"version"`
URLs struct {
StreamingAPI string `json:"streaming_api"`
} `json:"urls"`
Stats struct {
UserCount int `json:"user_count"`
StatusCount int `json:"status_count"`
DomainCount int `json:"domain_count"`
} `json:"stats"`
Thumbnail string `json:"thumbnail"`
Languages []string `json:"languages"`
Registrations bool `json:"registrations"`
ApprovalRequired bool `json:"approval_required"`
InvitesEnabled bool `json:"invites_enabled"`
Configuration Instance_Configuration_V1 `json:"configuration"`
ContactAccount Account `json:"contact_account"`
Rules []Rule `json:"rules"`
}
Instance_V1 represents the instance, in the shape returned by the deprecated v1 endpoint. https://docs.joinmastodon.org/entities/Instance_V1/
type List ¶
type List struct {
ID string `json:"id"` // The internal database ID of the list.
Title string `json:"title"` // The user-defined title of the list.
RepliesPolicy string `json:"replies_policy"` // Which replies should be shown in the list. [followed | list | none]
}
List represents a list of some users that the authenticated user follows. https://docs.joinmastodon.org/entities/List/
type Marker ¶
type Marker struct {
LastReadID string `json:"last_read_id"` // The ID of the most recently viewed entity.
Version int `json:"version"` // An incrementing counter, used for locking to prevent write conflicts.
UpdatedAt string `json:"updated_at"` // The timestamp of when the marker was set.
}
Marker represents the last read position within a user's timelines. https://docs.joinmastodon.org/entities/Marker/
type MediaAttachment ¶
type MediaAttachment struct {
ID string `json:"id"` // The ID of the attachment in the database.
Type string `json:"type"` // The type of the attachment. [ image | gifv | video | audio ]
URL string `json:"url"` // The location of the original full-size attachment.
PreviewURL string `json:"preview_url"` // The location of a scaled-down preview of the attachment.
RemoteURL string `json:"remote_url,omitempty"` // The location of the full-size original attachment on the remote website.
Meta map[string]any `json:"meta"` // Metadata returned by Paperclip. https://docs.joinmastodon.org/api/guidelines/#focal-points
Description string `json:"description"` // Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load.
Blurhash string `json:"blurhash"` // A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet. https://github.com/woltapp/blurhash
}
MediaAttachment represents a file or media attachment that can be added to a status. https://docs.joinmastodon.org/entities/MediaAttachment/
type NonNullSlice ¶ added in v0.6.0
type NonNullSlice[T any] []T
NonNullSlice wraps a slice so it always marshals as a JSON array ("[]"), even when the underlying slice is nil.
Go's encoding/json marshals a nil slice as "null" by default. The Mastodon API spec guarantees that certain fields (e.g. Account.Emojis, Account.Fields) are always present as arrays, and real client apps enforce this strictly -- the official Mastodon iOS app, for example, fails outright with a decoding error if one of these fields comes back "null" instead of "[]" (observed directly against a live server; not just a documentation reading).
Any field that the spec guarantees is always an array should use this type instead of a plain slice, so that guarantee holds regardless of how the value was constructed.
func (NonNullSlice[T]) MarshalJSON ¶ added in v0.6.0
func (s NonNullSlice[T]) MarshalJSON() ([]byte, error)
MarshalJSON guarantees this slice always serializes as a JSON array, never "null", by substituting an empty array when the underlying slice is nil.
type Notification ¶
type Notification struct {
ID string `json:"id"` // The id of the notification in the database.
Type string `json:"type"` // The type of event that resulted in the notification. [mention | status | reblog | follow | follow_request |favourite | poll | update | admin.sign_up | admin.report ]
CreatedAt string `json:"created_at"` // The timestamp of the notification. (ISO 8601 Datetime)
Account Account `json:"account"` // The account that performed the action that generated the notification.
Status *Status `json:"status,omitempty"` // Status that was the object of the notification. Attached when type of the notification is favourite, reblog, status, mention, poll, or update.
Report *AdminReport `json:"report,omitempty"` // Report that was the object of the notification. Attached when type of the notification is admin.report.
}
Notification represents a notification of an event relevant to the user. https://docs.joinmastodon.org/entities/Notification/
type NotificationFallback ¶ added in v0.6.0
type NotificationFallback struct {
Title string `json:"title"` // Localized fallback title (HTML).
Summary string `json:"summary,omitempty"` // Localized fallback summary (HTML), nullable.
Details string `json:"details,omitempty"` // Localized fallback details (HTML), nullable.
}
NotificationFallback represents localized fallback text for a notification type that a client may not support. https://docs.joinmastodon.org/entities/NotificationFallback/
type NotificationGroup ¶ added in v0.6.0
type NotificationGroup struct {
GroupKey string `json:"group_key"`
NotificationsCount int `json:"notifications_count"`
Type string `json:"type"`
MostRecentNotificationID string `json:"most_recent_notification_id"`
PageMinID string `json:"page_min_id,omitempty"`
PageMaxID string `json:"page_max_id,omitempty"`
LatestPageNotificationAt string `json:"latest_page_notification_at,omitempty"`
SampleAccountIDs []string `json:"sample_account_ids"`
StatusID string `json:"status_id,omitempty"`
Report *Report `json:"report,omitempty"`
Collection *Collection `json:"collection,omitempty"`
Fallback *NotificationFallback `json:"fallback,omitempty"`
Event *RelationshipSeveranceEvent `json:"event,omitempty"`
ModerationWarning *AccountWarning `json:"moderation_warning,omitempty"`
AnnualReport *AnnualReportEvent `json:"annual_report,omitempty"`
}
NotificationGroup represents a group of related notifications (e.g. multiple favourites of the same status), as returned by the grouped notifications API. https://docs.joinmastodon.org/entities/NotificationGroup/
type NotificationPolicy ¶ added in v0.6.0
type NotificationPolicy struct {
ForNotFollowing string `json:"for_not_following"` // [accept | filter | drop]
ForNotFollowers string `json:"for_not_followers"` // [accept | filter | drop]
ForNewAccounts string `json:"for_new_accounts"` // [accept | filter | drop]
ForPrivateMentions string `json:"for_private_mentions"` // [accept | filter | drop]
ForLimitedAccounts string `json:"for_limited_accounts"` // [accept | filter | drop]
ForBots string `json:"for_bots"` // [accept | filter | drop] - undocumented, verified against real server code
Summary NotificationPolicySummary `json:"summary"`
}
NotificationPolicy represents the notification filtering policy of the user. https://docs.joinmastodon.org/entities/NotificationPolicy/
type NotificationPolicySummary ¶ added in v0.6.0
type NotificationPolicySummary struct {
PendingRequestsCount int `json:"pending_requests_count"`
PendingNotificationsCount int `json:"pending_notifications_count"`
}
NotificationPolicySummary summarizes the notifications currently filtered by a NotificationPolicy.
type NotificationRequest ¶ added in v0.6.0
type NotificationRequest struct {
ID string `json:"id"` // The ID of the notification request in the database.
CreatedAt string `json:"created_at"` // (ISO 8601 Datetime)
UpdatedAt string `json:"updated_at"` // (ISO 8601 Datetime)
Account Account `json:"account"` // The account whose filtered notifications were grouped.
NotificationsCount string `json:"notifications_count"` // How many of this account's notifications were filtered.
LastStatus *Status `json:"last_status,omitempty"` // Most recent status associated with a filtered notification, if any.
}
NotificationRequest represents a group of filtered notifications from a specific user. https://docs.joinmastodon.org/entities/NotificationRequest/
type NotificationRequestsMerged ¶ added in v0.6.0
type NotificationRequestsMerged struct {
Merged bool `json:"merged"`
}
NotificationRequestsMerged reports whether previously-accepted notification requests have finished merging back into the main notifications list. https://docs.joinmastodon.org/methods/notifications/#requests-merged
type NotificationsUnreadCount ¶ added in v0.6.0
type NotificationsUnreadCount struct {
Count int `json:"count"`
}
NotificationsUnreadCount represents the (possibly capped) count of a user's unread notifications. https://docs.joinmastodon.org/methods/notifications/#unread-count
type PartialAccountWithAvatar ¶ added in v0.6.0
type PartialAccountWithAvatar struct {
ID string `json:"id"`
Acct string `json:"acct"`
Locked bool `json:"locked"`
Bot bool `json:"bot"`
URL string `json:"url"`
Avatar string `json:"avatar"`
AvatarStatic string `json:"avatar_static"`
AvatarDescription string `json:"avatar_description"`
}
PartialAccountWithAvatar is a stripped-down Account, used in grouped notification results when expand_accounts=partial_avatars is requested. https://docs.joinmastodon.org/entities/Account/#PartialAccountWithAvatar
type Poll ¶
type Poll struct {
ID string `json:"id"` // The ID of the poll in the database.
ExpiresAt string `json:"expires_at"` // When the poll ends. (ISO 8601 Datetime)
Expired bool `json:"expired"` // Is the poll currently expired?
Multiple bool `json:"multiple"` // Does the poll allow multiple-choice answers?
VotesCount int `json:"votes_count"` // How many votes have been received.
VotersCount int `json:"voters_count,omitempty"` // How many unique accounts have voted on a multiple-choice poll.
Options []PollOption `json:"options"` // Possible answers for the poll.
Emojis []CustomEmoji `json:"emojis"` // Custom emoji to be used for rendering poll options.
Voted bool `json:"voted,omitempty"` // When called with a user token, has the authorized user voted?
OwnVotes []int `json:"own_votes"` // When called with a user token, which options has the authorized user chosen? Contains an array of index values for options.
}
Poll represents a poll attached to a status. https://docs.joinmastodon.org/entities/Poll/
type PollOption ¶
type PollOption struct {
Title string `json:"title"` // The text value of the poll option.
VotesCount int `json:"votes_count"` // The total number of received votes for this option.
}
PollOption represents one choice in a poll, and its vote count. https://docs.joinmastodon.org/entities/Poll/#Option
type Preferences ¶ added in v0.6.0
type Preferences struct {
PostingDefaultVisibility string `json:"posting:default:visibility"` // [public | unlisted | private | direct]
PostingDefaultSensitive bool `json:"posting:default:sensitive"`
PostingDefaultLanguage string `json:"posting:default:language,omitempty"` // ISO 639-1 two-letter code, or empty/null
PostingDefaultQuotePolicy string `json:"posting:default:quote_policy"` // [public | followers | nobody] - undocumented, verified against real server code
ReadingExpandMedia string `json:"reading:expand:media"` // [default | show_all | hide_all]
ReadingExpandSpoilers bool `json:"reading:expand:spoilers"`
ReadingAutoplayGifs bool `json:"reading:autoplay:gifs"` // undocumented, verified against real server code
}
Preferences represents a user's preferences. https://docs.joinmastodon.org/entities/Preferences/
type PreviewCard ¶
type PreviewCard struct {
URL string `json:"url"` // Location of linked resource.
Title string `json:"title"` // Title of linked resource.
Description string `json:"description"` // Description of preview.
Type string `json:"type"` // The type of the preview card. [link | photo | video | rich]
AuthorName string `json:"author_name"` // The author of the original resource.
AuthorURL string `json:"author_url"` // A link to the author of the original resource.
ProviderName string `json:"provider_name"` // The provider of the original resource.
ProviderURL string `json:"provider_url"` // A link to the provider of the original resource.
HTML string `json:"html"` // HTML to be used for generating the preview card.
Width int `json:"width"` // Width of preview, in pixels.
Height int `json:"height"` // Height of preview, in pixels.
Image string `json:"image,omitempty"` // Preview thumbnail.
EmbedURL string `json:"embed_url"` // Used for photo embeds, instead of custom html.
Blurhash string `json:"blurhash"` // A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
ImageDescription string `json:"image_description,omitempty"`
PublishedAt string `json:"published_at,omitempty"`
Authors []PreviewCardAuthor `json:"authors"`
MissingAttribution bool `json:"missing_attribution,omitempty"`
}
PreviewCard represents a rich preview card that is generated using OpenGraph tags from a URL. https://docs.joinmastodon.org/entities/PreviewCard/
type PreviewCardAuthor ¶ added in v0.6.0
type PreviewCardAuthor struct {
Name string `json:"name"`
URL string `json:"url"`
Account *Account `json:"account,omitempty"`
}
PreviewCardAuthor credits an author of the content referenced by a PreviewCard. https://docs.joinmastodon.org/entities/PreviewCardAuthor/
type PrivacyPolicy ¶ added in v0.6.0
type PrivacyPolicy struct {
UpdatedAt string `json:"updated_at"` // (ISO 8601 Datetime)
Content string `json:"content"` // The rendered HTML content of the privacy policy.
}
PrivacyPolicy represents the server's privacy policy. https://docs.joinmastodon.org/entities/PrivacyPolicy/
type Quote ¶ added in v0.6.0
type Quote struct {
State string `json:"state"` //[pending|accepted|rejected|revoked|deleted|unauthorized]
QuotedStatus *Status `json:"quoted_status,omitempty"` // The status being quoted, if the quote is visible to you.
}
Quote represents a quote of another status, and its state. https://docs.joinmastodon.org/entities/Quote/
type QuoteApproval ¶ added in v0.6.0
type QuoteApproval struct {
Automatic []string `json:"automatic"` // Who is auto-approved to quote this status. [public | followers | following | unsupported_policy]
Manual []string `json:"manual"` // Who requires manual review to quote this status. [public | followers | following | unsupported_policy]
CurrentUser string `json:"current_user"` // How this policy applies to the requesting user. [automatic | manual | denied | unknown]
}
QuoteApproval summarizes a status' quote approval policy and how it applies to the requesting user. https://docs.joinmastodon.org/entities/QuoteApproval/
type Reaction ¶
type Reaction struct {
Name string `json:"name"` // The emoji used for the reaction. Either a unicode emoji, or a custom emoji’s shortcode.
Count int `json:"count"` // The total number of users who have added this reaction.
Me bool `json:"me"` // If there is a currently authorized user: Have you added this reaction?
URL string `json:"url"` // If the reaction is a custom emoji: A link to the custom emoji.
StaticURL string `json:"static_url"` // If the reaction is a custom emoji: A link to a non-animated version of the custom emoji.
}
Reaction represents an emoji reaction to an Announcement. https://docs.joinmastodon.org/entities/Reaction/
type Relationship ¶
type Relationship struct {
ID string `json:"id"` // The account ID.
Following bool `json:"following"` // Are you following this user?
ShowingReblogs bool `json:"showing_reblogs"` // Are you receiving this user’s boosts in your home timeline?
Notifying bool `json:"notifying"` // Have you enabled notifications for this user?
Languages []string `json:"languages"` // Which languages are you following from this user? ISO 8601 2-letter language codes
FollowedBy bool `json:"followed_by"` // Are you followed by this user?
Blocking bool `json:"blocking"` // Are you blocking this user?
BlockedBy bool `json:"blocked_by"` // Is this user blocking you?
Muting bool `json:"muting"` // Are you muting this user?
MutingNotifications bool `json:"muting_notifications"` // Are you muting notifications from this user?
Requested bool `json:"requested"` // Do you have a pending follow request for this user?
DomainBlocking bool `json:"domain_blocking"` // Are you blocking this user’s domain?
Endorsed bool `json:"endorsed"` // Are you featuring this user on your profile?
Note string `json:"note"` // The user’s profile bio
}
Relationship represents the relationship between accounts, such as following / blocking / muting / etc. https://docs.joinmastodon.org/entities/Relationship/
type RelationshipSeveranceEvent ¶ added in v0.6.0
type RelationshipSeveranceEvent struct {
ID string `json:"id"` // The ID of the event in the database.
Type string `json:"type"` // [account_suspension | domain_block | user_domain_block]
Purged bool `json:"purged"` // Whether the list of severed relationships is unavailable because the underlying account/domain was purged.
TargetName string `json:"target_name"` // Name of the target account or domain.
FollowersCount int `json:"followers_count"` // Number of followers that were severed.
FollowingCount int `json:"following_count"` // Number of followed accounts that were severed.
CreatedAt string `json:"created_at"` // (ISO 8601 Datetime)
}
RelationshipSeveranceEvent summarizes a moderation or block event that severed some of the account's follow relationships. https://docs.joinmastodon.org/entities/RelationshipSeveranceEvent/
type Report ¶
type Report struct {
ID string `json:"id"` // The ID of the report in the database.
ActionTaken bool `json:"action_taken"` // Whether an action was taken yet.
ActionTakenAt string `json:"action_taken_at"` // When an action was taken against the report. (ISO 8601 datetime)
Category string `json:"category"` // The generic reason for the report. (spam | violoation | other)
Comment string `json:"comment"` // The reason for the report.
Forwarded bool `json:"forwarded"` // Whether the report was forwarded to a remote domain.
CreatedAt string `json:"created_at"` // When the report was created.
StatusIDs []string `json:"status_ids,omitempty"` // IDs of statuses that have been attached to this report for additional context.
RuleIDs []string `json:"rule_ids,omitempty"` // IDs of the rules that have been cited as a violation by this report.
TargetAcount Account `json:"target_account"` // The account that was reported.
}
Report represents reports filed against users and/or statuses, to be taken action on by moderators. https://docs.joinmastodon.org/entities/Report/
type Role ¶ added in v0.6.0
type Role struct {
ID string `json:"id"`
Name string `json:"name"`
Permissions string `json:"permissions"` // Bitmask, cast to a string.
Color string `json:"color"` // Hex color code, or empty string.
Highlighted bool `json:"highlighted"` // Whether this role should be highlighted on a user's profile.
CollectionLimit int `json:"collection_limit"`
}
Role represents a set of permissions a user account can be granted. https://docs.joinmastodon.org/entities/Role/
type Rule ¶
type Rule struct {
ID string `json:"id"` // An identifier for the rule.
Text string `json:"text"` // The rule to be followed.
}
Rule represents a rule that server users should follow. https://docs.joinmastodon.org/entities/Rule/
type ScheduledStatus ¶
type ScheduledStatus struct {
ID string `json:"id"`
ScheduledAt string `json:"scheduled_at"`
Params map[string]any `json:"params"`
MediaAttachments []MediaAttachment `json:"media_attachments"`
}
ScheduledStatus represents a status that will be published at a future scheduled date. https://docs.joinmastodon.org/entities/ScheduledStatus/
type Search ¶
type Search struct {
Accounts NonNullSlice[Account] `json:"accounts"` // Accounts which match the given query
Statuses NonNullSlice[Status] `json:"statuses"` // Statuses which match the given query
}
Search represents the results of a search. https://docs.joinmastodon.org/entities/Search/
type ShallowTag ¶ added in v0.6.0
type ShallowTag struct {
Name string `json:"name"` // The hashtag name, not including the leading #.
URL string `json:"url"` // A link to the hashtag's page.
}
ShallowTag is a minimal reference to a Tag, used inside Collection. https://docs.joinmastodon.org/entities/ShallowTag/
type Status ¶
type Status struct {
ID string `json:"id"` // ID of the status in the database.
URI string `json:"uri"` // URI of the status used for federation.
CreatedAt string `json:"created_at"` // The date when this status was created. (ISO 8601 Datetime)
Account Account `json:"account"` // The account that authored this status.
Content string `json:"content"` // HTML-encoded status content.
Visibility string `json:"visibility"` // Visibility of this status. [public | unlisted | private | direct]
Sensitive bool `json:"sensitive"` // Is this status marked as sensitive content?
SpoilerText string `json:"spoiler_text"` // Subject or summary line, below which status content is collapsed until expanded.
MediaAttachments NonNullSlice[MediaAttachment] `json:"media_attachments"` // Media that is attached to this status.
Application *StatusApplication `json:"application,omitempty"` // The application used to post this status.
Mentions NonNullSlice[StatusMention] `json:"mentions"` // Mentions of users within the status content.
Tags NonNullSlice[StatusTag] `json:"tags"` // Hashtags used within the status content.
Emojis NonNullSlice[CustomEmoji] `json:"emojis"` // Custom emoji to be used when rendering status content.
ReblogsCount int `json:"reblogs_count"` // How many boosts this status has received.
FavouritesCount int `json:"favourites_count"` // How many favourites this status has received.
RepliesCount int `json:"replies_count"` // How many replies this status has received.
URL string `json:"url"` // A link to the status’s HTML representation.
InReplyToID string `json:"in_reply_to_id,omitempty"` // ID of the status being replied to.
InReplyToAccountID string `json:"in_reply_to_account_id,omitempty"` // ID of the account that authored the status being replied to.
Reblog *Status `json:"reblog,omitempty"` // The status being reblogged.
Poll *Poll `json:"poll,omitempty"` // The poll attached to the status.
Card *PreviewCard `json:"card,omitempty"` // Preview card for links included within status content.
Language string `json:"language,omitempty"` // Primary language of this status. (ISO 639 Part 1 two-letter language code)
Text string `json:"text"` // Plain-text source of a status. Returned instead of content when status is deleted, so the user may redraft from the source text without the client having to reverse-engineer the original text from the HTML content.
EditedAt string `json:"edited_at,omitempty"` // Timestamp of when the status was last edited. (ISO 8601 Datetime)
Favourited bool `json:"favourited"` // If the current token has an authorized user: Have you favourited this status?
Reblogged bool `json:"reblogged"` // If the current token has an authorized user: Have you boosted this status?
Muted bool `json:"muted"` // If the current token has an authorized user: Have you muted notifications for this status’s conversation?
Bookmarked bool `json:"bookmarked"` // If the current token has an authorized user: Have you bookmarked this status?
Pinned bool `json:"pinned"` // If the current token has an authorized user: Have you pinned this status? Only appears if the status is pinnable.
Filtered NonNullSlice[FilterResult] `json:"filtered"` // If the current token has an authorized user: The filter and keywords that matched this status.
QuotesCount int `json:"quotes_count"` // How many quotes this status has received.
Quote *Quote `json:"quote,omitempty"`
QuoteApproval *QuoteApproval `json:"quote_approval,omitempty"`
TaggedCollections NonNullSlice[Collection] `json:"tagged_collections"`
}
Status represents a status posted by an account. https://docs.joinmastodon.org/entities/Status/
type StatusApplication ¶
type StatusApplication struct {
Name string `json:"name"` // The name of the application that posted this status.
Website string `json:"website,omitempty"` // The website associated with the application that posted this status.
}
StatusApplication represents the application used to post a status. https://docs.joinmastodon.org/entities/Status/#application
type StatusEdit ¶
type StatusEdit struct {
Content string `json:"content"` // The content of the status at this revision.
SpoilerText string `json:"spoiler_text"` // The content of the subject or content warning at this revision.
Sensitive bool `json:"sensitive"` // Whether the status was marked sensitive at this revision.
CreatedAt string `json:"created_at"` // The timestamp of when the revision was published. (ISO 8601 Datetime)
Account Account `json:"account"` // The account that published this revision.
Poll *Poll `json:"poll"` // The current state of the poll options at this revision. Note that edits changing the poll options will be collapsed together into one edit, since this action resets the poll.
MediaAttachments []MediaAttachment `json:"media_attachments"` // The current state of the poll options at this revision. Note that edits changing the poll options will be collapsed together into one edit, since this action resets the poll.
Emojis []CustomEmoji `json:"emojis"` // Any custom emoji that are used in the current revision.
}
StatusEdit represents a revision of a status that has been edited. https://docs.joinmastodon.org/entities/StatusEdit/
type StatusMention ¶
type StatusMention struct {
ID string `json:"id"` // The account ID of the mentioned user.
Username string `json:"username"` // The username of the mentioned user.
URL string `json:"url"` // The location of the mentioned user’s profile.
Acct string `json:"acct"` // The webfinger acct: URI of the mentioned user. Equivalent to username for local users, or username@domain for remote users.
}
StatusMention represents an account mentioned within the content of a status. https://docs.joinmastodon.org/entities/Status/#mentions
type StatusSource ¶
type StatusSource struct {
ID string `json:"id"` // ID of the status in the database.
Text string `json:"text"` // The plain text used to compose the status.
SpoilerText string `json:"spoiler_text"` // The plain text used to compose the status’s subject or content warning.
}
StatusSource represents a status's source as plain text. https://docs.joinmastodon.org/entities/StatusSource/
type StatusTag ¶
type StatusTag struct {
Name string `json:"name"` // The value of the hashtag after the # sign.
URL string `json:"url"` // A link to the hashtag on the instance.
}
StatusTag represents a hashtag used within the content of a status. https://docs.joinmastodon.org/entities/Status/#Tag
type Suggestion ¶
type Suggestion struct {
Source string `json:"source"` // The reason this account is being suggested. [staff | past_interactions | global]
Account Account `json:"account"` // The account being recommended to follow.
}
Suggestion represents an account recommended to the authenticated user, and why. https://docs.joinmastodon.org/entities/Suggestion/
type Tag ¶
type Tag struct {
Name string `json:"name"` // The value of the hashtag after the # sign.
URL string `json:"url"` // A link to the hashtag on the instance.
History []TagHistory `json:"history"` // Usage statistics for given days (typically the past week).
Following bool `json:"following"` // Whether the current token’s authorized user is following this tag.
}
Tag represents a hashtag, and how often it has been used recently. https://docs.joinmastodon.org/entities/Tag/
type TagHistory ¶
type TagHistory struct {
Day string `json:"day"` // UNIX timestamp on midnight of the given day.
Uses string `json:"uses"` // The counted usage of the tag within that day.
Accounts string `json:"accounts"` // The total of accounts using the tag within that day.
}
TagHistory holds the usage statistics for a hashtag on a given day. https://docs.joinmastodon.org/entities/Tag/#history
type TermsOfService ¶ added in v0.6.0
type TermsOfService struct {
EffectiveDate string `json:"effective_date"` // (ISO 8601 Date)
Effective bool `json:"effective"` // Whether these are the currently active terms.
Content string `json:"content"` // The rendered HTML content.
SucceededBy string `json:"succeeded_by,omitempty"` // Effective date of the terms that succeeded these, if any.
}
TermsOfService represents a version of the server's terms of service. https://docs.joinmastodon.org/entities/TermsOfService/
type Token ¶
type Token struct {
AccessToken string `json:"access_token"` // An OAuth token to be used for authorization.
TokenType string `json:"token_type"` // The OAuth token type. Mastodon uses Bearer tokens.
Scope string `json:"scope"` // The OAuth scopes granted by this token, space-separated.
CreatedAt int64 `json:"created_at"` // When the token was generated. (Unix Timestamp)
ExpiresIn int64 `json:"expires_in,omitempty"` // Lifetime in seconds of the access token (RFC 6749 §5.1). Omitted when the token does not expire.
RefreshToken string `json:"refresh_token,omitempty"` // The refresh token used to obtain a new access token (RFC 6749 §6). Omitted when no refresh token is issued.
}
Token represents an OAuth token used to authorize requests, and to obtain a new one. https://docs.joinmastodon.org/entities/Token/
type Translation ¶
type Translation struct {
Content string `json:"content"` // HTML: The translated text of the status.
DetectedSourceLanguage string `json:"detected_source_language"` // ISO 639 Language Code: The language of the source text, as auto-detected by the machine translation provider.
Provider string `json:"provider"` // The service that provided the machine translation.
}
Translation represents the machine translation of a status. https://docs.joinmastodon.org/entities/Translation/
type V1_Filter ¶
type V1_Filter struct {
}
V1_Filter represents a keyword filter, in the shape returned by the deprecated v1 endpoints. https://docs.joinmastodon.org/entities/V1_Filter/
type WebPushSubscription ¶
type WebPushSubscription struct {
ID string `json:"id"` //The ID of the subscription in the database
Endpoint string `json:"endpoint"` //The endpoint of the subscription
Standard bool `json:"standard"` //standard (RFC8030+RFC8291+RFC8292)
Alerts WebPushSubscriptionAlerts `json:"alerts"` //which allert types are enabled for the subscription
ServerKey string `json:"server_key"` //the streaming server's VAPID public key
}
WebPushSubscription represents a subscription to the Web Push API. https://docs.joinmastodon.org/entities/WebPushSubscription/
type WebPushSubscriptionAlerts ¶ added in v0.6.0
type WebPushSubscriptionAlerts struct {
Mention bool `json:"mention"`
Quote bool `json:"quote"`
Status bool `json:"status"`
Reblog bool `json:"reblog"`
Follow bool `json:"follow"`
FollowRequest bool `json:"follow_request"`
Favourite bool `json:"favourite"`
Poll bool `json:"poll"`
Update bool `json:"update"`
QuotedUpdate bool `json:"quoted_update"`
AdminSignUp bool `json:"admin.sign_up"` // dotted JSON key, intentional
AdminReport bool `json:"admin.report"` // dotted JSON key, intentional
}
WebPushSubscriptionAlerts represents which notification types trigger a push alert for a given WebPushSubscription. https://docs.joinmastodon.org/entities/WebPushSubscription/#alerts
Source Files
¶
- account.go
- accountField.go
- accountSource.go
- accountWarning.go
- adminAccount.go
- adminCanonicalEmailBlock.go
- adminCohort.go
- adminDimension.go
- adminDomainAllow.go
- adminDomainBlock.go
- adminEmailDomainBlock.go
- adminIP.go
- adminIPBlock.go
- adminMeasure.go
- adminReport.go
- announcement.go
- announcementAccount.go
- announcementStatus.go
- annualReportEvent.go
- appeal.go
- application.go
- collection.go
- collectionItem.go
- collectionWithAccounts.go
- context.go
- conversation.go
- customEmoji.go
- doc.go
- domainBlock.go
- error.go
- extendedDescription.go
- familiarFollowers.go
- featureApproval.go
- featuredTag.go
- filter.go
- filterKeyword.go
- filterResult.go
- filterStatus.go
- groupedNotificationsResults.go
- identityProof.go
- instance.go
- instanceConfiguration.go
- instanceContact.go
- instanceRegistration.go
- instanceThumbnail.go
- instanceUsage.go
- instance_v1.go
- list.go
- marker.go
- mediaAttachment.go
- nonNullSlice.go
- notification.go
- notificationFallback.go
- notificationGroup.go
- notificationPolicy.go
- notificationPolicySummary.go
- notificationRequest.go
- notificationRequestsMerged.go
- notificationsUnreadCount.go
- partialAccountWithAvatar.go
- poll.go
- preference.go
- previewCard.go
- previewCardAuthor.go
- privacyPolicy.go
- quote.go
- quoteApproval.go
- reaction.go
- relatioinship.go
- relationshipSeveranceEvent.go
- report.go
- role.go
- rule.go
- scheduledStatus.go
- search.go
- shallowTag.go
- status.go
- statusApplication.go
- statusEdit.go
- statusMention.go
- statusSource.go
- statusTag.go
- suggestion.go
- tag.go
- tagHistory.go
- termsOfService.go
- token.go
- translation.go
- v1_filter.go
- webPushSubscription.go
- webPushSubscriptionAlerts.go