Documentation ¶
Index ¶
- type Helper
- func (h *Helper) GetAccessToken(ctx context.Context, redirectURI *url.URL, instance fedihelper.Instance, ...) (accessToken string, err error)
- func (h *Helper) GetCurrentAccount(ctx context.Context, instance fedihelper.Instance, accessToken string) (fedihelper.Account, error)
- func (*Helper) GetSoftware() fedihelper.SoftwareName
- func (h *Helper) MakeLoginURI(_ context.Context, redirectURI *url.URL, instance fedihelper.Instance) (*url.URL, error)
- func (h *Helper) RegisterApp(ctx context.Context, redirectURI *url.URL, instance fedihelper.Instance) (clientID string, clientSecret string, err error)
- func (h *Helper) SetFedi(f *fedihelper.FediHelper)
- func (h *Helper) UpdateAccountInfo(ctx context.Context, account fedihelper.Account) error
- func (h *Helper) UpdateInstanceInfo(ctx context.Context, instance fedihelper.Instance) error
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(k fedihelper.KV, t *fedihelper.Transport, appClientName, appWebsite, externalURL string) (*Helper, error)
New returns a new mastodon helper.
func (*Helper) GetAccessToken ¶
func (h *Helper) GetAccessToken(ctx context.Context, redirectURI *url.URL, instance fedihelper.Instance, 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 fedihelper.Instance, accessToken string) (fedihelper.Account, error)
GetCurrentAccount retrieves the current federated account.
func (*Helper) GetSoftware ¶
func (*Helper) GetSoftware() fedihelper.SoftwareName
GetSoftware returns the software type of this module.
func (*Helper) MakeLoginURI ¶
func (h *Helper) MakeLoginURI(_ context.Context, redirectURI *url.URL, instance fedihelper.Instance) (*url.URL, error)
MakeLoginURI creates a login redirect url for mastodon.
func (*Helper) RegisterApp ¶
func (h *Helper) RegisterApp(ctx context.Context, redirectURI *url.URL, instance fedihelper.Instance) (clientID string, clientSecret string, err error)
RegisterApp registers fedihelper with mastodon and returns the client id and client secret.
func (*Helper) SetFedi ¶
func (h *Helper) SetFedi(f *fedihelper.FediHelper)
SetFedi adds the fedi module to a helper.
func (*Helper) UpdateAccountInfo ¶ added in v0.17.0
func (*Helper) UpdateInstanceInfo ¶ added in v0.17.0
Click to show internal directories.
Click to hide internal directories.