object

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: AGPL-3.0 Imports: 0 Imported by: 2

Documentation

Index

Constants

View Source
const DomainBlockSeveritySilence = "silence"

Users from this domain will be hidden from timelines, threads, and notifications (unless you follow the user).

View Source
const DomainBlockSeveritySuspend = "suspend"

Incoming messages from this domain will be rejected and dropped entirely.

View Source
const ListRepliesPolicyFollowed = "followed"

Show replies to any followed user

View Source
const ListRepliesPolicyList = "list"

Show replies to members of the list

View Source
const ListRepliesPolicyNone = "none"

Show 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         []AccountField `json:"fields"`              // Metadata defined by the instance.
	Emojis         []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"`      // 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
}

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.
}

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.
}

https://docs.joinmastodon.org/entities/Account/#source

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.
}

Admin::Report 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"`      // When the announcement will start. (ISO 8601 Datetime) or null
	EndsAt      string                `json:"ends_at"`        // 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.
}

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.
}

https://docs.joinmastodon.org/entities/Announcement/#Status

type Application

type Application struct {
	Name         string `json:"name"`                    // The name of your application.
	Website      string `json:"website,omitempty"`       // The website associated with your application.
	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 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.
}

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 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      []string       `json:"context"`       // The contexts in which the filter should be applied. [notifications | public | thread | account]
	ExpiresAt    string         `json:"expires_at"`    // When the filter should no longer be applied. (ISO 8601 Datetime)
	FilterAction string         `json:"filter_action"` // The action to be taken when a status matches this filter. [warn | hide]
	Keywords     string         `json:"keywords"`      // The keywords grouped under this filter.
	Statuses     []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.
}

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 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"`
}

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.
}

Limits related to accounts. https://docs.joinmastodon.org/entities/Instance/#accounts

type InstanceConfigurationMediaAttachments

type InstanceConfigurationMediaAttachments struct {
	SupportedMimeTypes []string `json:"mime_types"`         // Contains MIME types that can be uploaded.
	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.
	VideoFrameLimit    int      `json:"video_frame_limit"`  // The maximum number of pixels (width times height) for video uploads.
}

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.
	MinExpiration int `json:"min_expiration"` // The shortest allowed poll duration, in seconds.
	MaxExpiration int `json:"max_expiration"` // The longest allowed poll duration, in seconds.
}
Limits related to polls.

https://docs.joinmastodon.org/entities/Instance/#polls

type InstanceConfigurationStatus

type InstanceConfigurationStatus struct {
	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_media"` // Each URL in a status will be assumed to be exactly this many characters.
}

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.
}

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.
}

URLs of interest for clients 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.
}

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.
}

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.
}

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.
}

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.
}

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.
}

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"`
}

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"`
}

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"`
}

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"`
}

type Instance_Statuses_V1 added in v0.2.0

type Instance_Statuses_V1 struct {
	MaxMediaAttachments      int `json:"max_media_attachments"`
	CharactersReservedPerURL int `json:"characters_reserved_per_url"`
}

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"`
	}
	Stats struct {
		UserCount   int `json:"user_count"`
		StatusCount int `json:"status_count"`
		DomainCount int `json:"domain_count"`
	}
	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"`
}

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 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 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.
}

https://docs.joinmastodon.org/entities/Poll/#Option

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.
}

PreviewCard represents a rich preview card that is generated using OpenGraph tags from a URL. https://docs.joinmastodon.org/entities/PreviewCard/

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 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 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 struct {
	Accounts []Account `json:"accounts"` // Accounts which match the given query
	Statuses []Status  `json:"statuses"` // Statuses which match the given query
	Hashtags []Tag     `json:"hashtags"` // Hashtags which match the given query
}

Search represents the results of a search. https://docs.joinmastodon.org/entities/Search/

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   []MediaAttachment  `json:"media_attachments"`                // Media that is attached to this status.
	Application        *StatusApplication `json:"application,omitempty"`            // The application used to post this status.
	Mentions           []StatusMention    `json:"mentions"`                         // Mentions of users within the status content.
	Tags               []StatusTag        `json:"tags"`                             // Hashtags used within the status content.
	Emojis             []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"`                        // 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           []FilterResult     `json:"filtered"`                         // If the current token has an authorized user: The filter and keywords that matched this status.
}

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.
}

The application used to post this 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.
}

Mentions of users within the status content. 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.
}

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.
}

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.
}

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.
}

Usage statistics for given days (typically the past week). https://docs.joinmastodon.org/entities/Tag/#history

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)
}

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.
}

https://docs.joinmastodon.org/entities/Translation/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL