logic

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

Error represents a logic specific error.

func NewError

func NewError(m string) *Error

NewError wraps a message in an Error object.

func NewErrorf

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

NewErrorf wraps a message in an Error object.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message as a string.

type Logic

type Logic interface {
	AddBlock(ctx context.Context, account *models.Account, block *models.Block) error
	AddBlocks(ctx context.Context, account *models.Account, blocks ...*models.Block) error
	DeleteBlock(ctx context.Context, account *models.Account, block *models.Block) error
	DeliverActivity(ctx context.Context, jid string, instanceID int64, activity fedihelper.Activity) error
	Domain() string
	GetBlockList(ctx context.Context) (*[]string, error)
	GetAccountConfigMap(ctx context.Context, keys ...models.ConfigKey) (*models.AccountConfigMap, error)
	GetConfigMap(ctx context.Context, keys ...models.ConfigKey) (*models.ConfigMap, error)
	GetConfigMapForAccount(ctx context.Context, accountID int64, keys ...models.ConfigKey) (*models.ConfigMap, error)
	GetInstance(ctx context.Context, domain string) (*models.Instance, error)
	GetInstanceForActor(ctx context.Context, actorID *url.URL) (*models.Instance, error)
	GetInstanceForServerHostname(ctx context.Context, serverHostname string) (*models.Instance, error)
	GetInstanceSelf(ctx context.Context) (*models.Instance, error)
	GetLoginURL(ctx context.Context, instance *models.Instance) (*url.URL, error)
	GetPeers(ctx context.Context) (*[]string, error)
	IsDomainBlocked(ctx context.Context, d string) (bool, error)
	MetricsGetAllDeliverErrorWeek(ctx context.Context) (map[*models.Instance]MetricsDataPointsTime, error)
	MetricsGetAllDeliverSuccessWeek(ctx context.Context) (map[*models.Instance]MetricsDataPointsTime, error)
	MetricsGetAllReceivedWeek(ctx context.Context) (map[*models.Instance]MetricsDataPointsTime, error)
	MetricsGetDeliverErrorWeek(ctx context.Context, instanceID int64) (*MetricsDataPointsTime, error)
	MetricsGetDeliverSuccessWeek(ctx context.Context, instanceID int64) (*MetricsDataPointsTime, error)
	MetricsGetReceivedWeek(ctx context.Context, instanceID int64) (*MetricsDataPointsTime, error)
	MetricsGetReceivedTotalWeek(ctx context.Context) (*MetricsDataPointsTime, error)
	MetricsIncDeliverError(ctx context.Context, instanceID int64)
	MetricsIncDeliverSuccess(ctx context.Context, instanceID int64)
	MetricsIncReceived(ctx context.Context, instanceID int64)
	ProcessActivity(ctx context.Context, jid string, instanceID int64, actorIRI *url.URL, activity fedihelper.Activity) error
	ProcessBlockAdd(ctx context.Context, blockID int64) error
	ProcessBlockDelete(ctx context.Context, blockID int64) error
	ProcessBlockUpdate(ctx context.Context, blockID int64) error
	ProcessConfigChanges(ctx context.Context, configChanges []*models.ConfigChange) error
	SendNotification(ctx context.Context, jid string, event models.EventType, metadata map[string]interface{}) error
	UpdateBlock(ctx context.Context, account *models.Account, changes []models.LogEntryBlockUpdateChange, block *models.Block) error
	ValidateRequest(r *http.Request, actorURI *url.URL) (bool, *fedihelper.Actor)
}

type MetricsDataPointTime added in v0.4.0

type MetricsDataPointTime struct {
	X time.Time
	Y int
}

type MetricsDataPointsTime added in v0.4.0

type MetricsDataPointsTime []MetricsDataPointTime

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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