fedi

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindActorURI

func FindActorURI(webfinger *models.WebFinger) (*url.URL, error)

FindActorURI parses a webfinger document for an actor uri.

Types

type Fedi

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

Fedi is a module for working with federated social instances.

func New

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

New creates a new fedi module.

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

func (f *Fedi) GetLoginURL(ctx context.Context, act string) (*url.URL, error)

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

func (f *Fedi) GetWellknownNodeInfo(ctx context.Context, domain string) (*models.NodeInfo, error)

GetWellknownNodeInfo retrieves wellknown nodeinfo from a federated instance.

func (*Fedi) GetWellknownWebFinger

func (f *Fedi) GetWellknownWebFinger(ctx context.Context, username, domain string) (*models.WebFinger, error)

GetWellknownWebFinger retrieves wellknown web finger resource from a federated instance.

func (*Fedi) Helper

func (f *Fedi) Helper(s Software) Helper

Helper returns a helper for a given software package.

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"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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