logic

package
v0.0.0-...-0f594a8 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SoftwareMastodon is the software keyword for Mastodon.
	SoftwareMastodon = "mastodon"
	// SoftwarePleroma is the software keyword for Pleroma.
	SoftwarePleroma = "pleroma"
)

Variables

View Source
var (
	ErrTokenWrongKind = errors.New("token is wrong kind")
)

Functions

This section is empty.

Types

type Error

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

Error represents a fedihelper specific error.

func NewError

func NewError(m string) *Error

NewError wraps a message in a Error object.

func NewErrorf

func NewErrorf(m string, args ...interface{}) *Error

NewErrorf wraps a message in a Error object.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message as a string.

type Logic

type Logic interface {
	ReadAccount(ctx context.Context, id int64) (*models.Account, error)
	ReadAccountByUsername(ctx context.Context, username string, instanceID int64) (*models.Account, error)

	CountInstances(ctx context.Context) (int64, error)
	CreateInstance(ctx context.Context, instance *models.Instance) error
	GetLoginURL(ctx context.Context, instance *models.Instance) (*url.URL, error)
	GetOrCreateInstance(ctx context.Context, domain string) (*models.Instance, error)
	NewInstanceFromDomain(ctx context.Context, domain string) (*models.Instance, error)
	ReadInstance(ctx context.Context, id int64) (*models.Instance, error)
	ReadInstanceByDomain(ctx context.Context, domain string) (*models.Instance, error)
	ReadInstanceByToken(ctx context.Context, token string) (*models.Instance, error)
	ReadInstancesPage(ctx context.Context, index, count int) ([]*models.Instance, error)

	MastodonOauth(r *http.Request, instance *models.Instance) (*models.Account, int, error)

	CountTags(ctx context.Context) (int64, error)
	CreateTag(ctx context.Context, tag *models.Tag) error
	ReadTagByName(ctx context.Context, name string) (*models.Tag, error)
	ReadTagsPage(ctx context.Context, index, count int) ([]*models.Tag, error)
}

type NoHelperError

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

NoHelperError represents a missing helper error.

func NewNoHelperError

func NewNoHelperError(software string) *NoHelperError

NewNoHelperError wraps a message in a NoHelperError object.

func (*NoHelperError) Error

func (e *NoHelperError) Error() string

Error returns the error message as a string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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