mastodon

package
v0.0.0-...-a05749a Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mastodon is a Mastodon account for Telephant.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	SigChan chan bool
	// contains filtered or unexported fields
}

Account is a Mastodon account for Telephant.

func NewAccount

func NewAccount(instance, token, clientID, clientSecret string) *Account

NewAccount returns a new Mastodon account.

func RegisterAccount

func RegisterAccount(instance string) (*Account, string, string, error)

RegisterAccount registers the app with an instance and retrieves an authentication URI.

func (*Account) Authenticate

func (mod *Account) Authenticate(code, redirectURI string) (string, string, string, string, error)

Authenticate finishes the authentication and retrieves an accesstoken from the instance, which we'll use for future logins.

func (*Account) DeletePost

func (mod *Account) DeletePost(id string) error

DeletePost deletes a post

func (*Account) Follow

func (mod *Account) Follow(id string) error

Follow follows another user

func (*Account) Like

func (mod *Account) Like(id string) error

Like favourites a post

func (*Account) List

func (mod *Account) List(id string, ch chan interface{}) error

List starts a list stream

func (*Account) LoadAccount

func (mod *Account) LoadAccount(id string) (accounts.ProfileEvent, []accounts.MessageEvent, error)

LoadAccount loads a profile's information.

func (*Account) LoadConversation

func (mod *Account) LoadConversation(id string) ([]accounts.MessageEvent, error)

LoadConversation loads a message conversation

func (mod *Account) Logo() string

Logo returns the Mastodon logo.

func (*Account) Panes

func (mod *Account) Panes() []accounts.Pane

Panes returns the panes this Mastodon account offers

func (*Account) Post

func (mod *Account) Post(message string, visibility string, attachments []string) error

Post posts a new status

func (*Account) PostLimitCount

func (mod *Account) PostLimitCount(body string) int

func (*Account) PublicTimeline

func (mod *Account) PublicTimeline(local bool, ch chan interface{}) error

PublicTimeline starts a stream for public timelines

func (*Account) Reply

func (mod *Account) Reply(replyid string, message string, visibility string, attachments []string) error

Reply posts a new reply-status

func (*Account) Run

func (mod *Account) Run(eventChan chan interface{}) error

Run executes the account's event loop.

func (*Account) Search

func (mod *Account) Search(token string, ch chan interface{}) error

Search starts a search

func (*Account) Share

func (mod *Account) Share(id string) error

Share boosts a post

func (*Account) Tag

func (mod *Account) Tag(token string, ch chan interface{}) error

Tag starts a hashtag stream

func (*Account) Unfollow

func (mod *Account) Unfollow(id string) error

Unfollow unfollows another user

func (*Account) Unlike

func (mod *Account) Unlike(id string) error

Unlike un-favourites a post

func (*Account) Unshare

func (mod *Account) Unshare(id string) error

Unshare deletes a boost for a post

func (*Account) UploadAttachment

func (mod *Account) UploadAttachment(url string)

UploadAttachment uploads an attachment to Mastodon

Jump to

Keyboard shortcuts

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