fedi

package
v0.0.0-...-89b6d9c Latest Latest
Warning

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

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

Documentation

Index

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

func SplitAccount

func SplitAccount(act string) (string, string, error)

SplitAccount splits a federated account into a username and domain

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) (*Fedi, error)

New creates a new fedi module

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, url *url.URL) (*models.NodeInfo20, 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) 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)
	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

type Software

type Software string

Software is a federated social software type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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