logic

package
v0.0.0-...-eb23ef5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCantCast       = errors.New("unable to cast interface to type")
	ErrTokenWrongKind = errors.New("token is wrong kind")
)

Functions

This section is empty.

Types

type Logic

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

func New

func New(ctx context.Context, d db.DB, h *ihttp.Client, k kv.KV, tokz *token.Tokenizer) (*Logic, error)

New created a new logic module

func (*Logic) FediHelper

func (l *Logic) FediHelper(s fedihelper.SoftwareName) fedihelper.Helper

FediHelper returns a helper for a given software package.

func (*Logic) GenInstanceFromDomain

func (l *Logic) GenInstanceFromDomain(ctx context.Context, domain string) (*models.Instance, error)

func (*Logic) GetInstanceForActor

func (l *Logic) GetInstanceForActor(ctx context.Context, actorID *url.URL) (*models.Instance, error)

func (*Logic) GetInstanceForServerHostname

func (l *Logic) GetInstanceForServerHostname(ctx context.Context, serverHostname string) (*models.Instance, error)

func (*Logic) GetInstanceSelf

func (l *Logic) GetInstanceSelf(ctx context.Context) (*models.Instance, error)

func (*Logic) GetLoginURL

func (l *Logic) GetLoginURL(ctx context.Context, instance *models.Instance) (*url.URL, error)

func (*Logic) HandleOauthCallback

func (l *Logic) HandleOauthCallback(r *http.Request, instance *models.Instance) (*models.Account, int, error)

func (*Logic) ReadAccountByToken

func (l *Logic) ReadAccountByToken(ctx context.Context, t string) (*models.Account, error)

func (*Logic) ReadInstanceByToken

func (l *Logic) ReadInstanceByToken(ctx context.Context, t string) (*models.Instance, error)

func (*Logic) ValidateRequest

func (l *Logic) ValidateRequest(r *http.Request, actorURI *url.URL) (bool, *fedihelper.Actor)

Jump to

Keyboard shortcuts

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