Documentation ¶
Index ¶
- func FindActorURI(webfinger *models.WebFinger) (*url.URL, error)
- type Fedi
- func (f *Fedi) GenerateFediInstanceFromDomain(ctx context.Context, domain string) (*models.FediInstance, error)
- func (f *Fedi) GetLoginURL(ctx context.Context, act string) (*url.URL, error)
- func (f *Fedi) GetNodeInfo20(ctx context.Context, domain string, infoURI *url.URL) (*models.NodeInfo2, error)
- func (f *Fedi) GetWellknownNodeInfo(ctx context.Context, domain string) (*models.NodeInfo, error)
- func (f *Fedi) GetWellknownWebFinger(ctx context.Context, username, domain string) (*models.WebFinger, error)
- func (f *Fedi) Helper(s Software) Helper
- type Helper
- type Software
Constants ¶
This section is empty.
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) GenerateFediInstanceFromDomain ¶
func (f *Fedi) GenerateFediInstanceFromDomain(ctx context.Context, domain string) (*models.FediInstance, error)
GenerateFediInstanceFromDomain created a FediInstance object by querying the apis of the federated instance.
func (*Fedi) GetLoginURL ¶
GetLoginURL retrieves an oauth url for a federated instance.
func (*Fedi) GetNodeInfo20 ¶
func (f *Fedi) GetNodeInfo20(ctx context.Context, domain string, infoURI *url.URL) (*models.NodeInfo2, 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) GetSoftware() Software RegisterApp(ctx context.Context, instance *models.FediInstance) (clientID string, clientSecret string, err error) SetFedi(f *Fedi) MakeLoginURI(ctx context.Context, instance *models.FediInstance) (loginURI *url.URL, err error) }
Helper interacts with a federated social instance.
type Software ¶
type Software string
Software is a federated social software type.
const ( // 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" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.