Documentation
¶
Overview ¶
Package mastodon provides functions and structs for accessing the mastodon API.
Index ¶
- Constants
- func Base64Encode(file *os.File) (string, error)
- func Base64EncodeFileName(filename string) (string, error)
- func String(v string) *string
- type APIError
- type Account
- type AccountSource
- type AdminAccount
- type AdminAccountAction
- type AdminReport
- type AppConfig
- type Application
- type ApplicationVerification
- type Attachment
- type AttachmentFocus
- type AttachmentMeta
- type AttachmentSize
- type Card
- type Client
- func (c *Client) AccountBlock(ctx context.Context, id ID) (*Relationship, error)
- func (c *Client) AccountFollow(ctx context.Context, id ID) (*Relationship, error)
- func (c *Client) AccountLookup(ctx context.Context, acct string) (*Account, error)
- func (c *Client) AccountMute(ctx context.Context, id ID) (*Relationship, error)
- func (c *Client) AccountStatuses(ctx context.Context, id ID, pg *Pagination) iter.Seq2[*Status, error]
- func (c *Client) AccountUnblock(ctx context.Context, id ID) (*Relationship, error)
- func (c *Client) AccountUnfollow(ctx context.Context, id ID) (*Relationship, error)
- func (c *Client) AccountUnmute(ctx context.Context, id ID) (*Relationship, error)
- func (c *Client) AccountUpdate(ctx context.Context, profile *Profile) (*Account, error)
- func (c *Client) AccountsSearch(ctx context.Context, q string, limit int64) ([]*Account, error)
- func (c *Client) AccountsSearchResolve(ctx context.Context, q string, limit int64, resolve bool) ([]*Account, error)
- func (c *Client) AddPushSubscription(ctx context.Context, endpoint string, public ecdsa.PublicKey, shared []byte, ...) (*PushSubscription, error)
- func (c *Client) AddToList(ctx context.Context, list ID, accounts ...ID) error
- func (c *Client) AdminAccountApprove(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) AdminAccountEnable(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) AdminAccountPerformAction(ctx context.Context, id ID, action *AdminAccountAction) error
- func (c *Client) AdminAccountReject(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) AdminAccountUnsensitive(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) AdminAccountUnsilence(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) AdminAccountUnsuspend(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) AdminReportAssignToSelf(ctx context.Context, id ID) (*AdminReport, error)
- func (c *Client) AdminReportReopen(ctx context.Context, id ID) (*AdminReport, error)
- func (c *Client) AdminReportResolve(ctx context.Context, id ID) (*AdminReport, error)
- func (c *Client) AdminReportUnassign(ctx context.Context, id ID) (*AdminReport, error)
- func (c *Client) Authenticate(ctx context.Context, username, password string) error
- func (c *Client) AuthenticateApp(ctx context.Context) error
- func (c *Client) AuthenticateToken(ctx context.Context, authCode, redirectURI string) error
- func (c *Client) Bookmark(ctx context.Context, id ID) (*Status, error)
- func (c *Client) ClearNotifications(ctx context.Context) error
- func (c *Client) CreateFilter(ctx context.Context, filter *Filter) (*Filter, error)
- func (c *Client) CreateList(ctx context.Context, title string) (*List, error)
- func (c *Client) DeleteConversation(ctx context.Context, id ID) error
- func (c *Client) DeleteFilter(ctx context.Context, id ID) error
- func (c *Client) DeleteList(ctx context.Context, id ID) error
- func (c *Client) DeleteStatus(ctx context.Context, id ID) error
- func (c *Client) DismissNotification(ctx context.Context, id ID) error
- func (c *Client) Favourite(ctx context.Context, id ID) (*Status, error)
- func (c *Client) FollowRemoteUser(ctx context.Context, uri string) (*Account, error)
- func (c *Client) FollowRequestAuthorize(ctx context.Context, id ID) error
- func (c *Client) FollowRequestReject(ctx context.Context, id ID) error
- func (c *Client) GetAccount(ctx context.Context, id ID) (*Account, error)
- func (c *Client) GetAccountCurrentUser(ctx context.Context) (*Account, error)
- func (c *Client) GetAccountFollowers(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)
- func (c *Client) GetAccountFollowing(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)
- func (c *Client) GetAccountLists(ctx context.Context, id ID) ([]*List, error)
- func (c *Client) GetAccountPinnedStatuses(ctx context.Context, id ID) ([]*Status, error)
- func (c *Client) GetAccountRelationships(ctx context.Context, ids []string) ([]*Relationship, error)
- func (c *Client) GetAccountStatuses(ctx context.Context, id ID, pg *Pagination) ([]*Status, error)
- func (c *Client) GetAccountStatusesParams(ctx context.Context, id ID, params url.Values, pg *Pagination) ([]*Status, error)
- func (c *Client) GetAdminAccount(ctx context.Context, id ID) (*AdminAccount, error)
- func (c *Client) GetAdminAccounts(ctx context.Context, pg *Pagination) ([]*AdminAccount, error)
- func (c *Client) GetAdminReport(ctx context.Context, id ID) (*AdminReport, error)
- func (c *Client) GetAdminReports(ctx context.Context, pg *Pagination) ([]*AdminReport, error)
- func (c *Client) GetAppAccessToken(ctx context.Context, redirectURI string) error
- func (c *Client) GetBlocks(ctx context.Context, pg *Pagination) ([]*Account, error)
- func (c *Client) GetBookmarks(ctx context.Context, pg *Pagination) ([]*Status, error)
- func (c *Client) GetConversations(ctx context.Context, pg *Pagination) ([]*Conversation, error)
- func (c *Client) GetEndorsements(ctx context.Context, pg *Pagination) ([]*Account, error)
- func (c *Client) GetFavouritedBy(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)
- func (c *Client) GetFavourites(ctx context.Context, pg *Pagination) ([]*Status, error)
- func (c *Client) GetFilter(ctx context.Context, id ID) (*Filter, error)
- func (c *Client) GetFilters(ctx context.Context) ([]*Filter, error)
- func (c *Client) GetFollowRequests(ctx context.Context, pg *Pagination) ([]*Account, error)
- func (c *Client) GetFollowedTags(ctx context.Context, pg *Pagination) ([]*FollowedTag, error)
- func (c *Client) GetInstance(ctx context.Context) (*Instance, error)
- func (c *Client) GetInstanceActivity(ctx context.Context) ([]*WeeklyActivity, error)
- func (c *Client) GetInstancePeers(ctx context.Context) ([]string, error)
- func (c *Client) GetList(ctx context.Context, id ID) (*List, error)
- func (c *Client) GetListAccounts(ctx context.Context, id ID) ([]*Account, error)
- func (c *Client) GetLists(ctx context.Context) ([]*List, error)
- func (c *Client) GetMediaStatus(ctx context.Context, attachment *Attachment) error
- func (c *Client) GetMutes(ctx context.Context, pg *Pagination) ([]*Account, error)
- func (c *Client) GetNotification(ctx context.Context, id ID) (*Notification, error)
- func (c *Client) GetNotifications(ctx context.Context, pg *Pagination) ([]*Notification, error)
- func (c *Client) GetNotificationsExclude(ctx context.Context, exclude *[]string, pg *Pagination) ([]*Notification, error)
- func (c *Client) GetPoll(ctx context.Context, id ID) (*Poll, error)
- func (c *Client) GetPushSubscription(ctx context.Context) (*PushSubscription, error)
- func (c *Client) GetRebloggedBy(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)
- func (c *Client) GetReports(ctx context.Context) ([]*Report, error)
- func (c *Client) GetStatus(ctx context.Context, id ID) (*Status, error)
- func (c *Client) GetStatusCard(ctx context.Context, id ID) (*Card, error)
- func (c *Client) GetStatusContext(ctx context.Context, id ID) (*Context, error)
- func (c *Client) GetStatusHistory(ctx context.Context, id ID) ([]*StatusHistory, error)
- func (c *Client) GetStatusSource(ctx context.Context, id ID) (*Source, error)
- func (c *Client) GetTimelineDirect(ctx context.Context, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTimelineHashtag(ctx context.Context, tag string, isLocal bool, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTimelineHashtagMultiple(ctx context.Context, tag string, isLocal bool, td *TagData, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTimelineHome(ctx context.Context, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTimelineList(ctx context.Context, id ID, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTimelineMedia(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTimelinePublic(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error)
- func (c *Client) GetTrendingStatuses(ctx context.Context, pg *Pagination) ([]*Status, error)
- func (c *Client) GetUserAccessToken(ctx context.Context, authCode, redirectURI string) error
- func (c *Client) MarkConversationAsRead(ctx context.Context, id ID) error
- func (c *Client) NewWSClient() *WSClient
- func (c *Client) Notifications(ctx context.Context, filter *NotificationFilter, pg *Pagination) iter.Seq2[*Notification, error]
- func (c *Client) PollVote(ctx context.Context, id ID, choices ...int) (*Poll, error)
- func (c *Client) PostStatus(ctx context.Context, toot *Toot) (*Status, error)
- func (c *Client) Reblog(ctx context.Context, id ID) (*Status, error)
- func (c *Client) RemoveFromList(ctx context.Context, list ID, accounts ...ID) error
- func (c *Client) RemovePushSubscription(ctx context.Context) error
- func (c *Client) RenameList(ctx context.Context, id ID, title string) (*List, error)
- func (c *Client) Report(ctx context.Context, accountID ID, ids []ID, comment string) (*Report, error)
- func (c *Client) RevokeToken(ctx context.Context) error
- func (c *Client) Search(ctx context.Context, q string, resolve bool) (*Results, error)
- func (c *Client) StreamingDirect(ctx context.Context) (chan Event, error)
- func (c *Client) StreamingHashtag(ctx context.Context, tag string, isLocal bool) (chan Event, error)
- func (c *Client) StreamingList(ctx context.Context, id ID) (chan Event, error)
- func (c *Client) StreamingPublic(ctx context.Context, isLocal bool) (chan Event, error)
- func (c *Client) StreamingUser(ctx context.Context) (chan Event, error)
- func (c *Client) TagFollow(ctx context.Context, tag string) (*FollowedTag, error)
- func (c *Client) TagInfo(ctx context.Context, tag string) (*FollowedTag, error)
- func (c *Client) TagUnfollow(ctx context.Context, ID string) (*FollowedTag, error)
- func (c *Client) TagsFollowed(ctx context.Context, pg *Pagination) ([]*FollowedTag, error)
- func (c *Client) Unbookmark(ctx context.Context, id ID) (*Status, error)
- func (c *Client) Unfavourite(ctx context.Context, id ID) (*Status, error)
- func (c *Client) Unreblog(ctx context.Context, id ID) (*Status, error)
- func (c *Client) UpdateFilter(ctx context.Context, id ID, filter *Filter) (*Filter, error)
- func (c *Client) UpdatePushSubscription(ctx context.Context, alerts *PushAlerts) (*PushSubscription, error)
- func (c *Client) UpdateStatus(ctx context.Context, toot *Toot, id ID) (*Status, error)
- func (c *Client) UploadMedia(ctx context.Context, file string) (*Attachment, error)
- func (c *Client) UploadMediaFromBytes(ctx context.Context, b []byte) (*Attachment, error)
- func (c *Client) UploadMediaFromMedia(ctx context.Context, media *Media) (*Attachment, error)
- func (c *Client) UploadMediaFromReader(ctx context.Context, reader io.Reader) (*Attachment, error)
- func (c *Client) VerifyAppCredentials(ctx context.Context) (*ApplicationVerification, error)
- type Config
- type Context
- type Conversation
- type ConversationEvent
- type DeleteEvent
- type Emoji
- type ErrorEvent
- type Event
- type Field
- type Filter
- type FilterResult
- type FollowedTag
- type FollowedTagHistory
- type History
- type ID
- type Instance
- type InstanceConfig
- type InstanceConfigMap
- type InstanceStats
- type List
- type Media
- type Mention
- type Notification
- type NotificationEvent
- type NotificationFilter
- type Pagination
- type Poll
- type PollOption
- type Profile
- type PushAlerts
- type PushSubscription
- type Relationship
- type Report
- type Results
- type Sbool
- type ScheduledParams
- type Source
- type Status
- type StatusHistory
- type Stream
- type Tag
- type TagData
- type Toot
- type TootPoll
- type UnixTimeString
- type Unixtime
- type UpdateEditEvent
- type UpdateEvent
- type WSClient
- func (c *WSClient) StreamingWSDirect(ctx context.Context) (chan Event, error)
- func (c *WSClient) StreamingWSHashtag(ctx context.Context, tag string, isLocal bool) (chan Event, error)
- func (c *WSClient) StreamingWSList(ctx context.Context, id ID) (chan Event, error)
- func (c *WSClient) StreamingWSPublic(ctx context.Context, isLocal bool) (chan Event, error)
- func (c *WSClient) StreamingWSUser(ctx context.Context) (chan Event, error)
- type WeeklyActivity
- type WriterResetter
Examples ¶
Constants ¶
const ( VisibilityPublic = "public" VisibilityUnlisted = "unlisted" VisibilityFollowersOnly = "private" VisibilityDirectMessage = "direct" )
Convenience constants for Toot.Visibility
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
Base64Encode returns the base64 data URI format string of the file.
func Base64EncodeFileName ¶
Base64EncodeFileName returns the base64 data URI format string of the file with the file name.
Types ¶
type Account ¶
type Account struct {
ID ID `json:"id"`
Username string `json:"username"`
Acct string `json:"acct"`
DisplayName string `json:"display_name"`
Locked bool `json:"locked"`
CreatedAt time.Time `json:"created_at"`
FollowersCount int64 `json:"followers_count"`
FollowingCount int64 `json:"following_count"`
StatusesCount int64 `json:"statuses_count"`
Note string `json:"note"`
URL string `json:"url"`
URI string `json:"uri"`
Avatar string `json:"avatar"`
AvatarStatic string `json:"avatar_static"`
Header string `json:"header"`
HeaderStatic string `json:"header_static"`
Emojis []Emoji `json:"emojis"`
Moved *Account `json:"moved"`
Fields []Field `json:"fields"`
Bot bool `json:"bot"`
Discoverable bool `json:"discoverable"`
Source *AccountSource `json:"source"`
FollowedTag []FollowedTag `json:"followed_tags"`
}
Account holds information for a mastodon account.
type AccountSource ¶ added in v0.0.4
type AccountSource struct {
Privacy *string `json:"privacy"`
Sensitive *bool `json:"sensitive"`
Language *string `json:"language"`
Note *string `json:"note"`
Fields *[]Field `json:"fields"`
}
AccountSource is a Mastodon account profile field.
type AdminAccount ¶ added in v0.0.13
type AdminAccount struct {
ID ID `json:"id"`
Username string `json:"username"`
Domain string `json:"domain"`
CreatedAt time.Time `json:"created_at"`
Email string `json:"email"`
IP string `json:"ip"`
Locale string `json:"locale"`
InviteRequest string `json:"invite_request"`
Confirmed bool `json:"confirmed"`
Approved bool `json:"approved"`
Disabled bool `json:"disabled"`
Silenced bool `json:"silenced"`
Suspended bool `json:"suspended"`
Account *Account `json:"account"`
}
AdminAccount holds the admin-level view of an account.
type AdminAccountAction ¶ added in v0.0.13
type AdminAccountAction struct {
// Type is one of none, sensitive, disable, silence and suspend.
Type string
Text string
ReportID ID
WarningPresetID ID
SendEmailNotification bool
}
AdminAccountAction specifies a moderation action against an account.
type AdminReport ¶ added in v0.0.13
type AdminReport struct {
ID ID `json:"id"`
ActionTaken bool `json:"action_taken"`
ActionTakenAt *time.Time `json:"action_taken_at"`
Category string `json:"category"`
Comment string `json:"comment"`
Forwarded bool `json:"forwarded"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Account *AdminAccount `json:"account"`
TargetAccount *AdminAccount `json:"target_account"`
AssignedAccount *AdminAccount `json:"assigned_account"`
ActionTakenByAccount *AdminAccount `json:"action_taken_by_account"`
Statuses []*Status `json:"statuses"`
}
AdminReport holds the admin-level view of a report.
type AppConfig ¶
type AppConfig struct {
http.Client
Server string
ClientName string
// Where the user should be redirected after authorization (for no redirect, use urn:ietf:wg:oauth:2.0:oob)
RedirectURIs string
// This can be a space-separated list of items listed on the /settings/applications/new page of any Mastodon
// instance. "read", "write", and "follow" are top-level scopes that include all the permissions of the more
// specific scopes like "read:favourites", "write:statuses", and "write:follows".
Scopes string
// Optional.
Website string
}
AppConfig is a setting for registering applications.
type Application ¶
type Application struct {
ID ID `json:"id"`
RedirectURI string `json:"redirect_uri"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
// AuthURI is not part of the Mastodon API; it is generated by go-mastodon.
AuthURI string `json:"auth_uri,omitempty"`
}
Application is a mastodon application.
func RegisterApp ¶
func RegisterApp(ctx context.Context, appConfig *AppConfig) (*Application, error)
RegisterApp returns the mastodon application.
Example ¶
package main
import (
"context"
"fmt"
"log"
"github.com/mattn/go-mastodon"
)
func main() {
app, err := mastodon.RegisterApp(context.Background(), &mastodon.AppConfig{
Server: "https://mstdn.jp",
ClientName: "client-name",
Scopes: "read write follow",
Website: "https://github.com/mattn/go-mastodon",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("client-id : %s\n", app.ClientID)
fmt.Printf("client-secret: %s\n", app.ClientSecret)
}
Output:
type ApplicationVerification ¶ added in v0.0.6
type ApplicationVerification struct {
Name string `json:"name"`
Website string `json:"website"`
VapidKey string `json:"vapid_key"`
}
ApplicationVerification is mastodon application.
type Attachment ¶
type Attachment struct {
ID ID `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
RemoteURL string `json:"remote_url"`
PreviewURL string `json:"preview_url"`
TextURL string `json:"text_url"`
Description string `json:"description"`
BlurHash string `json:"blurhash"`
Meta AttachmentMeta `json:"meta"`
}
Attachment hold information for attachment.
type AttachmentFocus ¶ added in v0.0.10
AttachmentSize holds information for attatchment size.
type AttachmentMeta ¶ added in v0.0.4
type AttachmentMeta struct {
Original AttachmentSize `json:"original"`
Small AttachmentSize `json:"small"`
Focus AttachmentFocus `json:"focus"`
}
AttachmentMeta holds information for attachment metadata.
type AttachmentSize ¶ added in v0.0.4
type AttachmentSize struct {
Width int64 `json:"width"`
Height int64 `json:"height"`
Size string `json:"size"`
Aspect float64 `json:"aspect"`
}
AttachmentSize holds information for attatchment size.
type Card ¶
type Card struct {
URL string `json:"url"`
Title string `json:"title"`
Description string `json:"description"`
Image string `json:"image"`
Type string `json:"type"`
AuthorName string `json:"author_name"`
AuthorURL string `json:"author_url"`
ProviderName string `json:"provider_name"`
ProviderURL string `json:"provider_url"`
HTML string `json:"html"`
Width int64 `json:"width"`
Height int64 `json:"height"`
}
Card holds information for a mastodon card.
type Client ¶
Client is a API client for mastodon.
Example ¶
package main
import (
"context"
"fmt"
"log"
"github.com/mattn/go-mastodon"
)
func main() {
c := mastodon.NewClient(&mastodon.Config{
Server: "https://mstdn.jp",
ClientID: "client-id",
ClientSecret: "client-secret",
})
err := c.Authenticate(context.Background(), "your-email", "your-password")
if err != nil {
log.Fatal(err)
}
timeline, err := c.GetTimelineHome(context.Background(), nil)
if err != nil {
log.Fatal(err)
}
for i := len(timeline) - 1; i >= 0; i-- {
fmt.Println(timeline[i])
}
}
Output:
func (*Client) AccountBlock ¶
AccountBlock blocks the account.
func (*Client) AccountFollow ¶
AccountFollow follows the account.
func (*Client) AccountLookup ¶ added in v0.0.8
AccountLookup returns the Account of specified acct uri.
func (*Client) AccountMute ¶
AccountMute mutes the account.
func (*Client) AccountStatuses ¶ added in v0.0.11
func (c *Client) AccountStatuses(ctx context.Context, id ID, pg *Pagination) iter.Seq2[*Status, error]
AccountStatuses iterates over statuses for the provided account id.
func (*Client) AccountUnblock ¶
AccountUnblock unblocks the account.
func (*Client) AccountUnfollow ¶
AccountUnfollow unfollows the account.
func (*Client) AccountUnmute ¶
AccountUnmute unmutes the account.
func (*Client) AccountUpdate ¶
AccountUpdate updates the information of the current user.
func (*Client) AccountsSearch ¶
AccountsSearch searches accounts by query.
func (*Client) AccountsSearchResolve ¶ added in v0.0.10
func (*Client) AddPushSubscription ¶ added in v0.0.5
func (c *Client) AddPushSubscription(ctx context.Context, endpoint string, public ecdsa.PublicKey, shared []byte, alerts PushAlerts) (*PushSubscription, error)
AddPushSubscription adds a new push subscription.
func (*Client) AddToList ¶ added in v0.0.4
AddToList adds accounts to a list.
Only accounts already followed by the user can be added to a list.
func (*Client) AdminAccountApprove ¶ added in v0.0.13
AdminAccountApprove approves the pending account.
func (*Client) AdminAccountEnable ¶ added in v0.0.13
AdminAccountEnable re-enables the disabled account.
func (*Client) AdminAccountPerformAction ¶ added in v0.0.13
func (c *Client) AdminAccountPerformAction(ctx context.Context, id ID, action *AdminAccountAction) error
AdminAccountPerformAction performs a moderation action against the account.
func (*Client) AdminAccountReject ¶ added in v0.0.13
AdminAccountReject rejects the pending account.
func (*Client) AdminAccountUnsensitive ¶ added in v0.0.13
AdminAccountUnsensitive removes the sensitive flag from the account.
func (*Client) AdminAccountUnsilence ¶ added in v0.0.13
AdminAccountUnsilence unsilences the account.
func (*Client) AdminAccountUnsuspend ¶ added in v0.0.13
AdminAccountUnsuspend unsuspends the account.
func (*Client) AdminReportAssignToSelf ¶ added in v0.0.13
AdminReportAssignToSelf assigns the report to the current user.
func (*Client) AdminReportReopen ¶ added in v0.0.13
AdminReportReopen reopens the resolved report.
func (*Client) AdminReportResolve ¶ added in v0.0.13
AdminReportResolve marks the report as resolved.
func (*Client) AdminReportUnassign ¶ added in v0.0.13
AdminReportUnassign unassigns the report.
func (*Client) Authenticate ¶
Authenticate gets access-token to the API. DEPRECATED: Authenticating with username and password is no longer supported, please use GetAppAccessToken() or GetUserAccessToken() instead
func (*Client) AuthenticateApp ¶ added in v0.0.6
AuthenticateApp logs in using client credentials. DEPRECATED: use GetAppAccessToken() instead
func (*Client) AuthenticateToken ¶ added in v0.0.3
AuthenticateToken logs in using a grant token returned by Application.AuthURI. redirectURI should be the same as Application.RedirectURI. DEPRECATED: Use GetUserAccessToken() instead
func (*Client) Bookmark ¶ added in v0.0.5
Bookmark bookmarks the toot of id and returns status of the bookmark toot.
func (*Client) ClearNotifications ¶
ClearNotifications clears notifications.
func (*Client) CreateFilter ¶ added in v0.0.5
CreateFilter creates a new filter.
func (*Client) CreateList ¶ added in v0.0.4
CreateList creates a new list with a given title.
func (*Client) DeleteConversation ¶ added in v0.0.5
DeleteConversation delete the conversation specified by id.
func (*Client) DeleteFilter ¶ added in v0.0.5
DeleteFilter removes a filter.
func (*Client) DeleteList ¶ added in v0.0.4
DeleteList removes a list.
func (*Client) DeleteStatus ¶
DeleteStatus delete the toot.
func (*Client) DismissNotification ¶ added in v0.0.5
DismissNotification deletes a single notification.
func (*Client) Favourite ¶
Favourite favourites the toot of id and returns status of the favourite toot.
func (*Client) FollowRemoteUser ¶
FollowRemoteUser sends follow-request.
func (*Client) FollowRequestAuthorize ¶
FollowRequestAuthorize authorizes the follow request of user with id.
func (*Client) FollowRequestReject ¶
FollowRequestReject rejects the follow request of user with id.
func (*Client) GetAccount ¶
GetAccount return Account.
func (*Client) GetAccountCurrentUser ¶
GetAccountCurrentUser returns the Account of current user.
func (*Client) GetAccountFollowers ¶
func (c *Client) GetAccountFollowers(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)
GetAccountFollowers returns followers list.
func (*Client) GetAccountFollowing ¶
func (c *Client) GetAccountFollowing(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)
GetAccountFollowing returns following list.
func (*Client) GetAccountLists ¶ added in v0.0.4
GetAccountLists returns the lists containing a given account.
func (*Client) GetAccountPinnedStatuses ¶ added in v0.0.5
GetAccountPinnedStatuses returns statuses pinned by specified accuont.
func (*Client) GetAccountRelationships ¶
func (c *Client) GetAccountRelationships(ctx context.Context, ids []string) ([]*Relationship, error)
GetAccountRelationships returns relationship for the account.
func (*Client) GetAccountStatuses ¶
GetAccountStatuses return statuses by specified account.
func (*Client) GetAccountStatusesParams ¶ added in v0.0.13
func (c *Client) GetAccountStatusesParams(ctx context.Context, id ID, params url.Values, pg *Pagination) ([]*Status, error)
GetAccountStatusesParams return statuses by specified account.
func (*Client) GetAdminAccount ¶ added in v0.0.13
GetAdminAccount returns an account from the admin view.
func (*Client) GetAdminAccounts ¶ added in v0.0.13
func (c *Client) GetAdminAccounts(ctx context.Context, pg *Pagination) ([]*AdminAccount, error)
GetAdminAccounts returns accounts from the admin view.
func (*Client) GetAdminReport ¶ added in v0.0.13
GetAdminReport returns a report from the admin view.
func (*Client) GetAdminReports ¶ added in v0.0.13
func (c *Client) GetAdminReports(ctx context.Context, pg *Pagination) ([]*AdminReport, error)
GetAdminReports returns reports from the admin view.
func (*Client) GetAppAccessToken ¶ added in v0.0.10
GetAppAccessToken exchanges API Credentials for an application Access Token https://docs.joinmastodon.org/api/oauth-tokens/#app-tokens
func (*Client) GetBookmarks ¶ added in v0.0.5
GetBookmarks returns the bookmark list of the current user.
func (*Client) GetConversations ¶ added in v0.0.5
func (c *Client) GetConversations(ctx context.Context, pg *Pagination) ([]*Conversation, error)
GetConversations return direct conversations.
func (*Client) GetEndorsements ¶ added in v0.0.8
GetEndorsements return accounts that the user is currently featuring on their profile.
func (*Client) GetFavouritedBy ¶
GetFavouritedBy returns the account list of the user who liked the toot of id.
func (*Client) GetFavourites ¶
GetFavourites returns the favorite list of the current user.
func (*Client) GetFilters ¶ added in v0.0.5
GetFilters returns all the filters on the current account.
func (*Client) GetFollowRequests ¶
GetFollowRequests returns follow requests.
func (*Client) GetFollowedTags ¶ added in v0.0.8
func (c *Client) GetFollowedTags(ctx context.Context, pg *Pagination) ([]*FollowedTag, error)
GetFollowedTags returns the list of Hashtags followed by the user.
func (*Client) GetInstance ¶
GetInstance returns Instance.
func (*Client) GetInstanceActivity ¶ added in v0.0.3
func (c *Client) GetInstanceActivity(ctx context.Context) ([]*WeeklyActivity, error)
GetInstanceActivity returns instance activity.
func (*Client) GetInstancePeers ¶ added in v0.0.3
GetInstancePeers returns instance peers.
func (*Client) GetListAccounts ¶ added in v0.0.4
GetListAccounts returns the accounts in a given list.
func (*Client) GetMediaStatus ¶ added in v0.0.11
func (c *Client) GetMediaStatus(ctx context.Context, attachment *Attachment) error
GetMediaStatus checks the status of a media attachment.
func (*Client) GetNotification ¶
GetNotification returns notification.
func (*Client) GetNotifications ¶
func (c *Client) GetNotifications(ctx context.Context, pg *Pagination) ([]*Notification, error)
GetNotifications returns notifications.
func (*Client) GetNotificationsExclude ¶ added in v0.0.10
func (c *Client) GetNotificationsExclude(ctx context.Context, exclude *[]string, pg *Pagination) ([]*Notification, error)
GetNotificationsExclude returns notifications with excluded notifications
func (*Client) GetPushSubscription ¶ added in v0.0.5
func (c *Client) GetPushSubscription(ctx context.Context) (*PushSubscription, error)
GetPushSubscription retrieves information about the active push subscription.
func (*Client) GetRebloggedBy ¶
GetRebloggedBy returns the account list of the user who reblogged the toot of id.
func (*Client) GetReports ¶
GetReports returns report of the current user.
func (*Client) GetStatusCard ¶
GetStatusCard returns status specified by id.
func (*Client) GetStatusContext ¶
GetStatusContext returns status specified by id.
func (*Client) GetStatusHistory ¶ added in v0.0.8
GetStatusHistory returns the status history specified by id.
func (*Client) GetStatusSource ¶ added in v0.0.8
GetStatusSource returns source data specified by id.
func (*Client) GetTimelineDirect ¶ added in v0.0.5
GetTimelineDirect return statuses from direct timeline.
func (*Client) GetTimelineHashtag ¶
func (c *Client) GetTimelineHashtag(ctx context.Context, tag string, isLocal bool, pg *Pagination) ([]*Status, error)
GetTimelineHashtag return statuses from tagged timeline.
func (*Client) GetTimelineHashtagMultiple ¶ added in v0.0.10
func (c *Client) GetTimelineHashtagMultiple(ctx context.Context, tag string, isLocal bool, td *TagData, pg *Pagination) ([]*Status, error)
GetTimelineHashtagMultiple return statuses from tagged timeline.
func (*Client) GetTimelineHome ¶
GetTimelineHome return statuses from home timeline.
func (*Client) GetTimelineList ¶ added in v0.0.4
GetTimelineList return statuses from a list timeline.
func (*Client) GetTimelineMedia ¶
func (c *Client) GetTimelineMedia(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error)
GetTimelineMedia return statuses from media timeline. NOTE: This is an experimental feature of pawoo.net.
func (*Client) GetTimelinePublic ¶
func (c *Client) GetTimelinePublic(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error)
GetTimelinePublic return statuses from public timeline.
func (*Client) GetTrendingStatuses ¶ added in v0.0.10
GetTrendingStatuses return statuses from explore timeline.
func (*Client) GetUserAccessToken ¶ added in v0.0.10
GetUserAccessToken exhanges a user provided authorization code for an User Access Token https://docs.joinmastodon.org/api/oauth-tokens/#user-tokens
func (*Client) MarkConversationAsRead ¶ added in v0.0.5
MarkConversationAsRead mark the conversation as read.
func (*Client) NewWSClient ¶
NewWSClient return WebSocket client.
func (*Client) Notifications ¶ added in v0.0.11
func (c *Client) Notifications(ctx context.Context, filter *NotificationFilter, pg *Pagination) iter.Seq2[*Notification, error]
Notifications iterate over notifications.
func (*Client) PollVote ¶ added in v0.0.5
PollVote votes on a poll specified by id, choices is the Poll.Options index to vote on
func (*Client) PostStatus ¶
PostStatus post the toot.
func (*Client) RemoveFromList ¶ added in v0.0.4
RemoveFromList removes accounts from a list.
func (*Client) RemovePushSubscription ¶ added in v0.0.5
RemovePushSubscription deletes the active push subscription.
func (*Client) RenameList ¶ added in v0.0.4
RenameList assigns a new title to a list.
func (*Client) Report ¶
func (c *Client) Report(ctx context.Context, accountID ID, ids []ID, comment string) (*Report, error)
Report reports the report
func (*Client) RevokeToken ¶ added in v0.0.13
RevokeToken revokes the access token of the client and clears it from the config on success.
func (*Client) StreamingDirect ¶ added in v0.0.5
StreamingDirect returns a channel to read events on a direct messages.
func (*Client) StreamingHashtag ¶
func (c *Client) StreamingHashtag(ctx context.Context, tag string, isLocal bool) (chan Event, error)
StreamingHashtag returns a channel to read events on tagged timeline.
func (*Client) StreamingList ¶ added in v0.0.4
StreamingList returns a channel to read events on a list.
func (*Client) StreamingPublic ¶
StreamingPublic returns a channel to read events on public.
func (*Client) StreamingUser ¶
StreamingUser returns a channel to read events on home.
func (*Client) TagUnfollow ¶ added in v0.0.8
TagUnfollow unfollows a hashtag.
func (*Client) TagsFollowed ¶ added in v0.0.10
func (c *Client) TagsFollowed(ctx context.Context, pg *Pagination) ([]*FollowedTag, error)
TagsFollowed returns a list of hashtags you follow.
func (*Client) Unbookmark ¶ added in v0.0.5
Unbookmark is unbookmark the toot of id and return status of the unbookmark toot.
func (*Client) Unfavourite ¶
Unfavourite unfavourites the toot of id and returns status of the unfavourite toot.
func (*Client) Unreblog ¶
Unreblog unreblogs the toot of id and returns status of the original toot.
func (*Client) UpdateFilter ¶ added in v0.0.5
UpdateFilter updates a filter.
func (*Client) UpdatePushSubscription ¶ added in v0.0.5
func (c *Client) UpdatePushSubscription(ctx context.Context, alerts *PushAlerts) (*PushSubscription, error)
UpdatePushSubscription updates which type of notifications are sent for the active push subscription.
func (*Client) UpdateStatus ¶ added in v0.0.8
UpdateStatus updates the toot.
func (*Client) UploadMedia ¶
UploadMedia upload a media attachment from a file.
func (*Client) UploadMediaFromBytes ¶ added in v0.0.6
UploadMediaFromBytes uploads a media attachment from a byte slice.
func (*Client) UploadMediaFromMedia ¶ added in v0.0.5
UploadMediaFromMedia uploads a media attachment from a Media struct.
func (*Client) UploadMediaFromReader ¶ added in v0.0.4
UploadMediaFromReader uploads a media attachment from an io.Reader.
func (*Client) VerifyAppCredentials ¶ added in v0.0.6
func (c *Client) VerifyAppCredentials(ctx context.Context) (*ApplicationVerification, error)
VerifyAppCredentials returns the mastodon application.
type Context ¶
type Context struct {
Ancestors []*Status `json:"ancestors"`
Descendants []*Status `json:"descendants"`
}
Context holds information for a mastodon context.
type Conversation ¶ added in v0.0.5
type Conversation struct {
ID ID `json:"id"`
Accounts []*Account `json:"accounts"`
Unread bool `json:"unread"`
LastStatus *Status `json:"last_status"`
}
Conversation holds information for a mastodon conversation.
type ConversationEvent ¶ added in v0.0.10
type ConversationEvent struct {
Conversation *Conversation `json:"conversation"`
}
ConversationEvent is a struct for passing conversationevent to app.
type DeleteEvent ¶
type DeleteEvent struct{ ID ID }
DeleteEvent is a struct for passing deletion event to app.
type Emoji ¶ added in v0.0.3
type Emoji struct {
ShortCode string `json:"shortcode"`
StaticURL string `json:"static_url"`
URL string `json:"url"`
VisibleInPicker bool `json:"visible_in_picker"`
}
Emoji hold information for CustomEmoji.
type ErrorEvent ¶
type ErrorEvent struct{ Err error }
ErrorEvent is a struct for passing errors to app.
func (*ErrorEvent) Error ¶
func (e *ErrorEvent) Error() string
type Event ¶
type Event interface {
// contains filtered or unexported methods
}
Event is an interface passing events to app.
type Field ¶ added in v0.0.3
type Field struct {
Name string `json:"name"`
Value string `json:"value"`
VerifiedAt time.Time `json:"verified_at"`
}
Field is a Mastodon account profile field.
type Filter ¶ added in v0.0.5
type Filter struct {
ID ID `json:"id"`
Phrase string `json:"phrase"`
Context []string `json:"context"`
WholeWord bool `json:"whole_word"`
ExpiresAt time.Time `json:"expires_at"`
Irreversible bool `json:"irreversible"`
}
Filter is metadata for a filter of users.
type FilterResult ¶ added in v0.0.10
type FilterResult struct {
Filter struct {
ID string `json:"id"`
Title string `json:"title"`
Context []string `json:"context"`
ExpiresAt time.Time `json:"expires_at"`
FilterAction string `json:"filter_action"`
} `json:"filter"`
KeywordMatches []string `json:"keyword_matches"`
StatusMatches []string `json:"status_matches"`
}
type FollowedTag ¶ added in v0.0.8
type FollowedTag struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
History []FollowedTagHistory `json:"history,omitempty"`
Following bool `json:"following,omitempty"`
}
FollowedTag is a Hash Tag followed by the user
type FollowedTagHistory ¶ added in v0.0.8
type FollowedTagHistory struct {
Day UnixTimeString `json:"day,omitempty"`
Accounts int `json:"accounts,string,omitempty"`
Uses int `json:"uses,string,omitempty"`
}
History is the history of a followed tag
type History ¶ added in v0.0.3
type History struct {
Day string `json:"day"`
Uses string `json:"uses"`
Accounts string `json:"accounts"`
}
History hold information for history.
type ID ¶ added in v0.0.2
type ID string
func (ID) Compare ¶ added in v0.0.10
Compare compares the Mastodon IDs i and j. Compare returns:
-1 if i is less than j, 0 if i equals j, +1 if i is greater than j.
Shorter IDs sort before longer ones and IDs of the same length are compared lexicographically. This matches the numeric order of the integer IDs used by Mastodon while also supporting non-numeric IDs (e.g. ULIDs) used by other implementations.
Compare can be used as an argument of slices.SortFunc:
slices.SortFunc([]mastodon.ID{id1, id2}, mastodon.ID.Compare)
func (*ID) UnmarshalJSON ¶ added in v0.0.2
type Instance ¶
type Instance struct {
URI string `json:"uri"`
Title string `json:"title"`
Description string `json:"description"`
EMail string `json:"email"`
Version string `json:"version,omitempty"`
Thumbnail string `json:"thumbnail,omitempty"`
URLs map[string]string `json:"urls,omitempty"`
Stats *InstanceStats `json:"stats,omitempty"`
Languages []string `json:"languages"`
ContactAccount *Account `json:"contact_account"`
Configuration *InstanceConfig `json:"configuration"`
}
Instance holds information for a mastodon instance.
func (*Instance) GetConfig ¶ added in v0.0.8
func (c *Instance) GetConfig() *InstanceConfig
GetConfig returns InstanceConfig.
type InstanceConfig ¶ added in v0.0.8
type InstanceConfig struct {
Accounts *InstanceConfigMap `json:"accounts"`
Statuses *InstanceConfigMap `json:"statuses"`
MediaAttachments map[string]interface{} `json:"media_attachments"`
Polls *InstanceConfigMap `json:"polls"`
}
InstanceConfig holds configuration accessible for clients.
type InstanceConfigMap ¶ added in v0.0.8
type InstanceConfigMap map[string]interface{}
type InstanceStats ¶ added in v0.0.3
type InstanceStats struct {
UserCount int64 `json:"user_count"`
StatusCount int64 `json:"status_count"`
DomainCount int64 `json:"domain_count"`
}
InstanceStats holds information for mastodon instance stats.
type Mention ¶
type Mention struct {
URL string `json:"url"`
Username string `json:"username"`
Acct string `json:"acct"`
ID ID `json:"id"`
}
Mention hold information for mention.
type Notification ¶
type Notification struct {
ID ID `json:"id"`
Type string `json:"type"`
CreatedAt time.Time `json:"created_at"`
Account Account `json:"account"`
Status *Status `json:"status"`
}
Notification holds information for a mastodon notification.
type NotificationEvent ¶
type NotificationEvent struct {
Notification *Notification `json:"notification"`
}
NotificationEvent is a struct for passing notification event to app.
type NotificationFilter ¶ added in v0.0.11
type NotificationFilter struct {
Includes []string // list of notifications types to include
Excludes []string // list of notifications types to exclude
}
NotificationFilter customizes how a notification query is submitted to the remote Mastodon server. See:
https://docs.joinmastodon.org/methods/notifications/
type Pagination ¶
Pagination is a struct for specifying the get range.
Example ¶
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/mattn/go-mastodon"
)
func main() {
c := mastodon.NewClient(&mastodon.Config{
Server: "https://mstdn.jp",
ClientID: "client-id",
ClientSecret: "client-secret",
})
var followers []*mastodon.Account
var pg mastodon.Pagination
for {
fs, err := c.GetAccountFollowers(context.Background(), "1", &pg)
if err != nil {
log.Fatal(err)
}
followers = append(followers, fs...)
if pg.MaxID == "" {
break
}
time.Sleep(10 * time.Second)
}
for _, f := range followers {
fmt.Println(f.Acct)
}
}
Output:
type Poll ¶ added in v0.0.5
type Poll struct {
ID ID `json:"id"`
ExpiresAt time.Time `json:"expires_at"`
Expired bool `json:"expired"`
Multiple bool `json:"multiple"`
VotesCount int64 `json:"votes_count"`
VotersCount int64 `json:"voters_count"`
Options []PollOption `json:"options"`
Voted bool `json:"voted"`
OwnVotes []int `json:"own_votes"`
Emojis []Emoji `json:"emojis"`
}
Poll holds information for mastodon polls.
type PollOption ¶ added in v0.0.5
Poll holds information for a mastodon poll option.
type Profile ¶
type Profile struct {
// If it is nil it will not be updated.
// If it is empty, update it with empty.
DisplayName *string
Note *string
Locked *bool
Fields *[]Field
Source *AccountSource
// Set the base64 encoded character string of the image.
Avatar string
Header string
}
Profile is a struct for updating profiles.
type PushAlerts ¶ added in v0.0.5
type PushSubscription ¶ added in v0.0.5
type PushSubscription struct {
ID ID `json:"id"`
Endpoint string `json:"endpoint"`
ServerKey string `json:"server_key"`
Alerts *PushAlerts `json:"alerts"`
}
type Relationship ¶
type Relationship struct {
ID ID `json:"id"`
Following bool `json:"following"`
FollowedBy bool `json:"followed_by"`
Blocking bool `json:"blocking"`
Muting bool `json:"muting"`
MutingNotifications bool `json:"muting_notifications"`
Requested bool `json:"requested"`
DomainBlocking bool `json:"domain_blocking"`
ShowingReblogs bool `json:"showing_reblogs"`
Endorsed bool `json:"endorsed"`
}
Relationship holds information for relationship to the account.
type ScheduledParams ¶ added in v0.0.8
type ScheduledParams struct {
ApplicationID ID `json:"application_id"`
Idempotency string `json:"idempotency"`
InReplyToID interface{} `json:"in_reply_to_id"`
MediaIDs []ID `json:"media_ids"`
Poll *Poll `json:"poll"`
ScheduledAt *time.Time `json:"scheduled_at,omitempty"`
Sensitive bool `json:"sensitive"`
SpoilerText string `json:"spoiler_text"`
Text string `json:"text"`
Visibility string `json:"visibility"`
}
ScheduledStatus holds information returned when ScheduledAt is set on a status
type Source ¶ added in v0.0.8
type Source struct {
ID ID `json:"id"`
Text string `json:"text"`
SpoilerText string `json:"spoiler_text"`
}
Source holds source properties so a status can be edited.
type Status ¶
type Status struct {
ID ID `json:"id"`
URI string `json:"uri"`
URL string `json:"url"`
Account Account `json:"account"`
InReplyToID interface{} `json:"in_reply_to_id"`
InReplyToAccountID interface{} `json:"in_reply_to_account_id"`
Reblog *Status `json:"reblog"`
Content string `json:"content"`
CreatedAt time.Time `json:"created_at"`
EditedAt time.Time `json:"edited_at"`
Emojis []Emoji `json:"emojis"`
RepliesCount int64 `json:"replies_count"`
ReblogsCount int64 `json:"reblogs_count"`
FavouritesCount int64 `json:"favourites_count"`
Reblogged interface{} `json:"reblogged"`
Favourited interface{} `json:"favourited"`
Bookmarked interface{} `json:"bookmarked"`
Muted interface{} `json:"muted"`
Sensitive bool `json:"sensitive"`
SpoilerText string `json:"spoiler_text"`
Visibility string `json:"visibility"`
MediaAttachments []Attachment `json:"media_attachments"`
Mentions []Mention `json:"mentions"`
Tags []Tag `json:"tags"`
Card *Card `json:"card"`
Poll *Poll `json:"poll"`
Application Application `json:"application"`
Language string `json:"language"`
Pinned interface{} `json:"pinned"`
ScheduledParams ScheduledParams `json:"params"`
Filtered []FilterResult `json:"filtered"`
}
Status is struct to hold status.
type StatusHistory ¶ added in v0.0.8
type StatusHistory struct {
Content string `json:"content"`
SpoilerText string `json:"spoiler_text"`
Account Account `json:"account"`
Sensitive bool `json:"sensitive"`
CreatedAt time.Time `json:"created_at"`
Emojis []Emoji `json:"emojis"`
MediaAttachments []Attachment `json:"media_attachments"`
}
StatusHistory is a struct to hold status history data.
type Stream ¶
type Stream struct {
Event string `json:"event"`
Payload interface{} `json:"payload"`
}
Stream is a struct of data that flows in streaming.
type Tag ¶
type Tag struct {
Name string `json:"name"`
URL string `json:"url"`
History []History `json:"history"`
}
Tag hold information for tag.
type Toot ¶
type Toot struct {
Status string `json:"status"`
InReplyToID ID `json:"in_reply_to_id"`
MediaIDs []ID `json:"media_ids"`
Sensitive bool `json:"sensitive"`
SpoilerText string `json:"spoiler_text"`
Visibility string `json:"visibility"`
Language string `json:"language"`
ScheduledAt *time.Time `json:"scheduled_at,omitempty"`
Poll *TootPoll `json:"poll"`
}
Toot is a struct to post status.
type TootPoll ¶ added in v0.0.5
type TootPoll struct {
Options []string `json:"options"`
ExpiresInSeconds int64 `json:"expires_in"`
Multiple bool `json:"multiple"`
HideTotals bool `json:"hide_totals"`
}
TootPoll holds information for creating a poll in Toot.
type UnixTimeString ¶ added in v0.0.8
UnixTimeString represents a time in a Unix Epoch string
func (UnixTimeString) MarshalJSON ¶ added in v0.0.12
func (u UnixTimeString) MarshalJSON() ([]byte, error)
func (*UnixTimeString) UnmarshalJSON ¶ added in v0.0.8
func (u *UnixTimeString) UnmarshalJSON(b []byte) error
type Unixtime ¶ added in v0.0.3
func (Unixtime) MarshalJSON ¶ added in v0.0.12
func (*Unixtime) UnmarshalJSON ¶ added in v0.0.3
type UpdateEditEvent ¶ added in v0.0.8
type UpdateEditEvent struct {
Status *Status `json:"status"`
}
UpdateEditEvent is a struct for passing status edit event to app.
type UpdateEvent ¶
type UpdateEvent struct {
Status *Status `json:"status"`
}
UpdateEvent is a struct for passing status event to app.
type WSClient ¶
WSClient is a WebSocket client.
func (*WSClient) StreamingWSDirect ¶ added in v0.0.10
StreamingWSDirect return channel to read events on a direct messages using WebSocket.
func (*WSClient) StreamingWSHashtag ¶
func (c *WSClient) StreamingWSHashtag(ctx context.Context, tag string, isLocal bool) (chan Event, error)
StreamingWSHashtag return channel to read events on tagged timeline using WebSocket.
func (*WSClient) StreamingWSList ¶ added in v0.0.4
StreamingWSList return channel to read events on a list using WebSocket.
func (*WSClient) StreamingWSPublic ¶
StreamingWSPublic return channel to read events on public using WebSocket.
type WeeklyActivity ¶ added in v0.0.3
type WeeklyActivity struct {
Week Unixtime `json:"week"`
Statuses int64 `json:"statuses,string"`
Logins int64 `json:"logins,string"`
Registrations int64 `json:"registrations,string"`
}
WeeklyActivity holds information for mastodon weekly activity.
type WriterResetter ¶ added in v0.0.9
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
mstdn
module
|
|
|
examples
|
|
|
public-application
command
|
|
|
user-credentials
command
|
|
|
user-oauth-authorization
command
|