mastodon

package
v0.0.0-...-e647751 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

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

Helper is a mastodon helper.

func New

func New(d db.DB, k kv.KV, t *token.Tokenizer) (*Helper, error)

New returns a new mastodon helper.

func (*Helper) GetAccessToken

func (h *Helper) GetAccessToken(ctx context.Context, instance *models.FediInstance, code string) (accessToken string, err error)

GetAccessToken gets an access token for a account from a returned code.

func (*Helper) GetCurrentAccount

func (h *Helper) GetCurrentAccount(ctx context.Context, instance *models.FediInstance, accessToken string) (*models.FediAccount, error)

GetCurrentAccount retrieves the current federated account.

func (*Helper) GetSoftware

func (*Helper) GetSoftware() fedi.Software

GetSoftware returns the software type of this module.

func (*Helper) MakeLoginURI

func (h *Helper) MakeLoginURI(_ context.Context, instance *models.FediInstance) (*url.URL, error)

MakeLoginURI creates a login redirect url for mastodon.

func (*Helper) RegisterApp

func (h *Helper) RegisterApp(ctx context.Context, instance *models.FediInstance) (string, string, error)

RegisterApp registers feditools with mastodon and returns the client id and client secret.

func (*Helper) SetFedi

func (h *Helper) SetFedi(f *fedi.Fedi)

SetFedi adds the fedi module to a helper.

Jump to

Keyboard shortcuts

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