api

package
v0.0.0-...-33d7cd8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountClient

type AccountClient struct {
	Client      *mastodon.Client
	Streams     map[string]*Stream
	Me          *mastodon.Account
	WSClient    *mastodon.WSClient
	InstanceOld *mastodon.Instance
	Instance    *mastodon.InstanceV2
}

func (*AccountClient) AddUserToList

func (ac *AccountClient) AddUserToList(u *mastodon.Account, l *mastodon.List) error

func (*AccountClient) BlockToggle

func (ac *AccountClient) BlockToggle(u *User) (*mastodon.Relationship, error)

func (*AccountClient) BlockUser

func (ac *AccountClient) BlockUser(u *mastodon.Account) (*mastodon.Relationship, error)

func (*AccountClient) Bookmark

func (ac *AccountClient) Bookmark(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) BookmarkToogle

func (ac *AccountClient) BookmarkToogle(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) Boost

func (ac *AccountClient) Boost(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) BoostToggle

func (ac *AccountClient) BoostToggle(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) ClearNotifications

func (ac *AccountClient) ClearNotifications() error

func (*AccountClient) DeleteStatus

func (ac *AccountClient) DeleteStatus(s *mastodon.Status) error

func (*AccountClient) DeleteUserFromList

func (ac *AccountClient) DeleteUserFromList(u *mastodon.Account, l *mastodon.List) error

func (*AccountClient) Favorite

func (ac *AccountClient) Favorite(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) FavoriteToogle

func (ac *AccountClient) FavoriteToogle(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) FollowRequestAccept

func (ac *AccountClient) FollowRequestAccept(u *mastodon.Account) error

func (*AccountClient) FollowRequestDeny

func (ac *AccountClient) FollowRequestDeny(u *mastodon.Account) error

func (*AccountClient) FollowTag

func (ac *AccountClient) FollowTag(tag string) error

func (*AccountClient) FollowToggle

func (ac *AccountClient) FollowToggle(u *User) (*mastodon.Relationship, error)

func (*AccountClient) FollowUser

func (ac *AccountClient) FollowUser(u *mastodon.Account) (*mastodon.Relationship, error)

func (*AccountClient) GetBlocking

func (ac *AccountClient) GetBlocking(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetBookmarks

func (ac *AccountClient) GetBookmarks(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetBoostsStatus

func (ac *AccountClient) GetBoostsStatus(pg *mastodon.Pagination, id mastodon.ID) ([]Item, error)

func (*AccountClient) GetCharLimit

func (ac *AccountClient) GetCharLimit() int

func (*AccountClient) GetConversations

func (ac *AccountClient) GetConversations(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetFavorites

func (ac *AccountClient) GetFavorites(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetFavoritesStatus

func (ac *AccountClient) GetFavoritesStatus(pg *mastodon.Pagination, id mastodon.ID) ([]Item, error)

func (*AccountClient) GetFollowRequests

func (ac *AccountClient) GetFollowRequests(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetFollowers

func (ac *AccountClient) GetFollowers(pg *mastodon.Pagination, id mastodon.ID) ([]Item, error)

func (*AccountClient) GetFollowing

func (ac *AccountClient) GetFollowing(pg *mastodon.Pagination, id mastodon.ID) ([]Item, error)

func (*AccountClient) GetFollowingForList

func (ac *AccountClient) GetFollowingForList(pg *mastodon.Pagination, id mastodon.ID, data interface{}) ([]Item, error)

func (*AccountClient) GetHistory

func (ac *AccountClient) GetHistory(status *mastodon.Status) ([]Item, error)

func (*AccountClient) GetLengthURL

func (ac *AccountClient) GetLengthURL() int

func (*AccountClient) GetListStatuses

func (ac *AccountClient) GetListStatuses(pg *mastodon.Pagination, id mastodon.ID) ([]Item, error)

func (*AccountClient) GetListUsers

func (ac *AccountClient) GetListUsers(pg *mastodon.Pagination, id mastodon.ID, data interface{}) ([]Item, error)

func (*AccountClient) GetLists

func (ac *AccountClient) GetLists() ([]Item, error)

func (*AccountClient) GetMuting

func (ac *AccountClient) GetMuting(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetNotifications

func (ac *AccountClient) GetNotifications(nth []config.NotificationToHide, pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetPollOptions

func (ac *AccountClient) GetPollOptions() (options, chars int)

func (*AccountClient) GetStatus

func (ac *AccountClient) GetStatus(id mastodon.ID) (*mastodon.Status, error)

func (*AccountClient) GetTag

func (ac *AccountClient) GetTag(pg *mastodon.Pagination, search string) ([]Item, error)

func (*AccountClient) GetTagMultiple

func (ac *AccountClient) GetTagMultiple(pg *mastodon.Pagination, search string) ([]Item, error)

func (*AccountClient) GetTags

func (ac *AccountClient) GetTags(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetThread

func (ac *AccountClient) GetThread(status *mastodon.Status) ([]Item, error)

func (*AccountClient) GetTimeline

func (ac *AccountClient) GetTimeline(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetTimelineFederated

func (ac *AccountClient) GetTimelineFederated(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetTimelineLocal

func (ac *AccountClient) GetTimelineLocal(pg *mastodon.Pagination) ([]Item, error)

func (*AccountClient) GetUser

func (ac *AccountClient) GetUser(pg *mastodon.Pagination, id mastodon.ID) ([]Item, error)

func (*AccountClient) GetUserByID

func (ac *AccountClient) GetUserByID(id mastodon.ID) (Item, error)

func (*AccountClient) GetUserPinned

func (ac *AccountClient) GetUserPinned(id mastodon.ID) ([]Item, error)

func (*AccountClient) GetUsers

func (ac *AccountClient) GetUsers(search string) ([]Item, error)

func (*AccountClient) MuteToggle

func (ac *AccountClient) MuteToggle(u *User) (*mastodon.Relationship, error)

func (*AccountClient) MuteUser

func (ac *AccountClient) MuteUser(u *mastodon.Account) (*mastodon.Relationship, error)

func (*AccountClient) NewDirectStream

func (ac *AccountClient) NewDirectStream() (*Receiver, string, error)

func (*AccountClient) NewFederatedStream

func (ac *AccountClient) NewFederatedStream() (*Receiver, string, error)

func (*AccountClient) NewGenericStream

func (ac *AccountClient) NewGenericStream(st StreamType, data string) (rec *Receiver, err error)

func (*AccountClient) NewHomeStream

func (ac *AccountClient) NewHomeStream() (*Receiver, string, error)

func (*AccountClient) NewListStream

func (ac *AccountClient) NewListStream(id mastodon.ID) (*Receiver, string, error)

func (*AccountClient) NewLocalStream

func (ac *AccountClient) NewLocalStream() (*Receiver, string, error)

func (*AccountClient) NewTagStream

func (ac *AccountClient) NewTagStream(tag string) (*Receiver, string, error)

func (*AccountClient) RemoveConversationReceiver

func (ac *AccountClient) RemoveConversationReceiver(rec *Receiver)

func (*AccountClient) RemoveFederatedReceiver

func (ac *AccountClient) RemoveFederatedReceiver(rec *Receiver)

func (*AccountClient) RemoveGenericReceiver

func (ac *AccountClient) RemoveGenericReceiver(rec *Receiver, st StreamType, data string)

func (*AccountClient) RemoveHomeReceiver

func (ac *AccountClient) RemoveHomeReceiver(rec *Receiver)

func (*AccountClient) RemoveListReceiver

func (ac *AccountClient) RemoveListReceiver(rec *Receiver, id mastodon.ID)

func (*AccountClient) RemoveLocalReceiver

func (ac *AccountClient) RemoveLocalReceiver(rec *Receiver)

func (*AccountClient) RemoveTagReceiver

func (ac *AccountClient) RemoveTagReceiver(rec *Receiver, tag string)

func (*AccountClient) SavePreferences

func (ac *AccountClient) SavePreferences(p *mastodon.Profile) error

func (*AccountClient) TagToggleFollow

func (ac *AccountClient) TagToggleFollow(tag *mastodon.Tag) (*mastodon.Tag, error)

func (*AccountClient) UnblockUser

func (ac *AccountClient) UnblockUser(u *mastodon.Account) (*mastodon.Relationship, error)

func (*AccountClient) Unbookmark

func (ac *AccountClient) Unbookmark(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) Unboost

func (ac *AccountClient) Unboost(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) Unfavorite

func (ac *AccountClient) Unfavorite(s *mastodon.Status) (*mastodon.Status, error)

func (*AccountClient) UnfollowTag

func (ac *AccountClient) UnfollowTag(tag string) error

func (*AccountClient) UnfollowUser

func (ac *AccountClient) UnfollowUser(u *mastodon.Account) (*mastodon.Relationship, error)

func (*AccountClient) UnmuteUser

func (ac *AccountClient) UnmuteUser(u *mastodon.Account) (*mastodon.Relationship, error)

func (*AccountClient) Vote

func (ac *AccountClient) Vote(poll *mastodon.Poll, choices ...int) (*mastodon.Poll, error)

type Item

type Item interface {
	ID() uint
	Type() MastodonType
	ToggleCW()
	ShowCW() bool
	Raw() interface{}
	URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)
	Filtered(config.FeedType) (bool, string, string, bool)
	ForceViewFilter()
	Pinned() bool
	Refetch(*AccountClient) bool
}

func NewListsItem

func NewListsItem(item *mastodon.List) Item

func NewNotificationItem

func NewNotificationItem(item *mastodon.Notification, user *User) (nitem Item)

func NewStatusHistoryItem

func NewStatusHistoryItem(item *mastodon.StatusHistory) (sitem Item)

func NewStatusItem

func NewStatusItem(item *mastodon.Status, pinned bool) (sitem Item)

func NewStatusItemID

func NewStatusItemID(item *mastodon.Status, pinned bool, id uint) (sitem Item)

func NewTagItem

func NewTagItem(item *mastodon.Tag) Item

func NewUserItem

func NewUserItem(item *User, profile bool) Item

type ListItem

type ListItem struct {
	// contains filtered or unexported fields
}

func (*ListItem) Filtered

func (s *ListItem) Filtered(config.FeedType) (bool, string, string, bool)

func (*ListItem) ForceViewFilter

func (l *ListItem) ForceViewFilter()

func (*ListItem) ID

func (s *ListItem) ID() uint

func (*ListItem) Pinned

func (n *ListItem) Pinned() bool

func (*ListItem) Raw

func (s *ListItem) Raw() interface{}

func (*ListItem) Refetch

func (l *ListItem) Refetch(ac *AccountClient) bool

func (*ListItem) ShowCW

func (s *ListItem) ShowCW() bool

func (*ListItem) ToggleCW

func (s *ListItem) ToggleCW()

func (*ListItem) Type

func (s *ListItem) Type() MastodonType

func (*ListItem) URLs

func (s *ListItem) URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)

type MastodonType

type MastodonType uint
const (
	StatusType MastodonType = iota
	StatusHistoryType
	UserType
	ProfileType
	NotificationType
	ListsType
	TagType
)

type NotificationData

type NotificationData struct {
	Item   *mastodon.Notification
	Status Item
	User   Item
}

type NotificationItem

type NotificationItem struct {
	// contains filtered or unexported fields
}

func (*NotificationItem) Filtered

func (*NotificationItem) ForceViewFilter

func (n *NotificationItem) ForceViewFilter()

func (*NotificationItem) ID

func (n *NotificationItem) ID() uint

func (*NotificationItem) Pinned

func (n *NotificationItem) Pinned() bool

func (*NotificationItem) Raw

func (n *NotificationItem) Raw() interface{}

func (*NotificationItem) Refetch

func (n *NotificationItem) Refetch(ac *AccountClient) bool

func (*NotificationItem) ShowCW

func (n *NotificationItem) ShowCW() bool

func (*NotificationItem) ToggleCW

func (n *NotificationItem) ToggleCW()

func (*NotificationItem) Type

func (n *NotificationItem) Type() MastodonType

func (*NotificationItem) URLs

func (n *NotificationItem) URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)

type Receiver

type Receiver struct {
	Ch     chan mastodon.Event
	Closed bool
	// contains filtered or unexported fields
}

type RequestData

type RequestData struct {
	MinID mastodon.ID
	MaxID mastodon.ID
}

type StatusHistoryItem

type StatusHistoryItem struct {
	// contains filtered or unexported fields
}

func (*StatusHistoryItem) Filtered

func (*StatusHistoryItem) ForceViewFilter

func (t *StatusHistoryItem) ForceViewFilter()

func (*StatusHistoryItem) ID

func (s *StatusHistoryItem) ID() uint

func (*StatusHistoryItem) Pinned

func (s *StatusHistoryItem) Pinned() bool

func (*StatusHistoryItem) Raw

func (s *StatusHistoryItem) Raw() interface{}

func (*StatusHistoryItem) Refetch

func (s *StatusHistoryItem) Refetch(ac *AccountClient) bool

func (*StatusHistoryItem) ShowCW

func (s *StatusHistoryItem) ShowCW() bool

func (*StatusHistoryItem) ToggleCW

func (s *StatusHistoryItem) ToggleCW()

func (*StatusHistoryItem) Type

func (s *StatusHistoryItem) Type() MastodonType

func (*StatusHistoryItem) URLs

func (s *StatusHistoryItem) URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)

type StatusItem

type StatusItem struct {
	// contains filtered or unexported fields
}

func (*StatusItem) Filtered

func (s *StatusItem) Filtered(tl config.FeedType) (bool, string, string, bool)

func (*StatusItem) ForceViewFilter

func (s *StatusItem) ForceViewFilter()

func (*StatusItem) ID

func (s *StatusItem) ID() uint

func (*StatusItem) Pinned

func (s *StatusItem) Pinned() bool

func (*StatusItem) Raw

func (s *StatusItem) Raw() interface{}

func (*StatusItem) Refetch

func (s *StatusItem) Refetch(ac *AccountClient) bool

func (*StatusItem) ShowCW

func (s *StatusItem) ShowCW() bool

func (*StatusItem) ToggleCW

func (s *StatusItem) ToggleCW()

func (*StatusItem) Type

func (s *StatusItem) Type() MastodonType

func (*StatusItem) URLs

func (s *StatusItem) URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func (*Stream) AddReceiver

func (s *Stream) AddReceiver() *Receiver

func (*Stream) ID

func (s *Stream) ID() string

func (*Stream) RemoveReceiver

func (s *Stream) RemoveReceiver(r *Receiver)

type StreamType

type StreamType uint
const (
	HomeStream StreamType = iota
	LocalStream
	FederatedStream
	DirectStream
	TagStream
	ListStream
)

type TagItem

type TagItem struct {
	// contains filtered or unexported fields
}

func (*TagItem) Filtered

func (t *TagItem) Filtered(config.FeedType) (bool, string, string, bool)

func (*TagItem) ForceViewFilter

func (t *TagItem) ForceViewFilter()

func (*TagItem) ID

func (t *TagItem) ID() uint

func (*TagItem) Pinned

func (t *TagItem) Pinned() bool

func (*TagItem) Raw

func (t *TagItem) Raw() interface{}

func (*TagItem) Refetch

func (t *TagItem) Refetch(ac *AccountClient) bool

func (*TagItem) ShowCW

func (t *TagItem) ShowCW() bool

func (*TagItem) ToggleCW

func (t *TagItem) ToggleCW()

func (*TagItem) Type

func (t *TagItem) Type() MastodonType

func (*TagItem) URLs

func (t *TagItem) URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)

type TimelineType

type TimelineType uint

type User

type User struct {
	Data           *mastodon.Account
	Relation       *mastodon.Relationship
	AdditionalData interface{}
}

type UserItem

type UserItem struct {
	// contains filtered or unexported fields
}

func (*UserItem) Filtered

func (u *UserItem) Filtered(config.FeedType) (bool, string, string, bool)

func (*UserItem) ForceViewFilter

func (u *UserItem) ForceViewFilter()

func (*UserItem) ID

func (u *UserItem) ID() uint

func (*UserItem) Pinned

func (u *UserItem) Pinned() bool

func (*UserItem) Raw

func (u *UserItem) Raw() interface{}

func (*UserItem) Refetch

func (u *UserItem) Refetch(ac *AccountClient) bool

func (*UserItem) ShowCW

func (u *UserItem) ShowCW() bool

func (*UserItem) ToggleCW

func (u *UserItem) ToggleCW()

func (*UserItem) Type

func (u *UserItem) Type() MastodonType

func (*UserItem) URLs

func (u *UserItem) URLs() ([]util.URL, []mastodon.Mention, []mastodon.Tag, int)

Jump to

Keyboard shortcuts

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