Documentation ¶
Index ¶
- Constants
- func SplitAccount(act string) (string, string, error)
- type Fedi
- func (f *Fedi) GetLoginURL(ctx context.Context, act string) (*url.URL, error)
- func (f *Fedi) GetNodeInfo20(ctx context.Context, domain string, url *url.URL) (*models.NodeInfo20, error)
- func (f *Fedi) GetWellknownNodeInfo(ctx context.Context, domain string) (*models.NodeInfo, error)
- func (f *Fedi) Helper(s Software) Helper
- type Helper
- type Software
Constants ¶
View Source
const ( // AppWebsite is the uri of the project AppWebsite = "https://github.com/tyrm/feditools" // NodeInfo20Schema the schema url for nodeinfo 2.0 NodeInfo20Schema = "http://nodeinfo.diaspora.software/ns/schema/2.0" // SoftwareMastodon is the software keyword for Mastodon SoftwareMastodon Software = "mastodon" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fedi ¶
type Fedi struct {
// contains filtered or unexported fields
}
Fedi is a module for working with federated social instances
func (*Fedi) GetLoginURL ¶
GetLoginURL retrieves an oauth url for a federated instance
func (*Fedi) GetNodeInfo20 ¶
func (f *Fedi) GetNodeInfo20(ctx context.Context, domain string, url *url.URL) (*models.NodeInfo20, error)
GetNodeInfo20 retrieves wellknown nodeinfo from a federated instance
func (*Fedi) GetWellknownNodeInfo ¶
GetWellknownNodeInfo retrieves wellknown nodeinfo from a federated instance
type Helper ¶
type Helper interface { GetAccessToken(ctx context.Context, instance *models.FediInstance, code string) (accessToken string, err error) GetCurrentAccount(ctx context.Context, instance *models.FediInstance, accessToken string) (user *models.FediAccount, err error) RegisterApp(ctx context.Context, instance *models.FediInstance) (clientID string, clientSecret string, err error) MakeLoginURL(ctx context.Context, instance *models.FediInstance) (url *url.URL, err error) }
Helper interacts with a federated social instance
Source Files ¶
Click to show internal directories.
Click to hide internal directories.