logic

package
v0.0.0-...-a915469 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid  = errors.New("invalid")
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Auth

type Auth interface {
	RequireAuth(r *http.Request) (*models.Token, gdhttp.ErrCode, string)
}

type Key

type Key interface {
	GenerateSigningKey() (ed25519.PrivateKey, error)
	GetPublicKey() (string, error)
	IsEphemeralPubKeyValid(ctx context.Context, pubKey string) (bool, error)
	IsPubKeyValid(ctx context.Context, pubKey string) (bool, error)
}

type Logic

type Logic interface {
	Auth
	Key
	Terms
	Token
}

type Terms

type Terms interface {
	AddAgreedTerms(ctx context.Context, account *models.Account, urls []string) error
	GetTerms(ctx context.Context) models.Terms
}

type Token

type Token interface {
	IssueToken(ctx context.Context, mxID string) (*models.Token, error)
	DeleteToken(ctx context.Context, token *models.Token) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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