logic1

package
v0.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logic

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

Logic contains shared logic for the application

func New

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

New created a new logic module

func (*Logic) AddBlock

func (l *Logic) AddBlock(ctx context.Context, account *models.Account, block *models.Block) error

func (*Logic) AddBlocks added in v0.3.0

func (l *Logic) AddBlocks(ctx context.Context, account *models.Account, blocks ...*models.Block) error

func (*Logic) DeleteBlock

func (l *Logic) DeleteBlock(ctx context.Context, account *models.Account, block *models.Block) error

func (*Logic) DeliverActivity

func (l *Logic) DeliverActivity(ctx context.Context, jid string, instanceID int64, activity fedihelper.Activity) error

func (*Logic) Domain

func (l *Logic) Domain() string

func (*Logic) EnqueueAccountInfoUpdates added in v0.7.0

func (l *Logic) EnqueueAccountInfoUpdates(ctx context.Context) error

func (*Logic) EnqueueInstanceInfoUpdates added in v0.7.0

func (l *Logic) EnqueueInstanceInfoUpdates(ctx context.Context) error

func (*Logic) GetAccountConfigMap added in v0.2.0

func (l *Logic) GetAccountConfigMap(ctx context.Context, keys ...models.ConfigKey) (*models.AccountConfigMap, error)

func (*Logic) GetBlockList

func (l *Logic) GetBlockList(ctx context.Context) (*[]string, error)

GetBlockList returns a list of blocked domains

func (*Logic) GetConfigMap

func (l *Logic) GetConfigMap(ctx context.Context, keys ...models.ConfigKey) (*models.ConfigMap, error)

func (*Logic) GetConfigMapForAccount added in v0.2.0

func (l *Logic) GetConfigMapForAccount(ctx context.Context, accountID int64, keys ...models.ConfigKey) (*models.ConfigMap, error)

func (*Logic) GetInstance

func (l *Logic) GetInstance(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) GetInstancesForForwarding

func (l *Logic) GetInstancesForForwarding(ctx context.Context, actorIRI, objectID string) ([]*models.Instance, error)

func (*Logic) GetLoginURL

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

func (*Logic) GetPeers

func (l *Logic) GetPeers(ctx context.Context) (*[]string, error)

GetPeers returns a list of peers

func (*Logic) GetSchedulerJobs added in v0.6.0

func (l *Logic) GetSchedulerJobs() ([]logic.SchedulerJob, error)

func (*Logic) IsDomainBlocked

func (l *Logic) IsDomainBlocked(ctx context.Context, d string) (bool, error)

IsDomainBlocked returns true if a domain matches a block in the database

func (*Logic) KickInstance added in v0.7.0

func (l *Logic) KickInstance(ctx context.Context, instance *models.Instance, account *models.Account, admin bool) error

func (*Logic) MaintDeliveryErrorTimeout added in v0.6.0

func (l *Logic) MaintDeliveryErrorTimeout(ctx context.Context, jid string) error

func (*Logic) MetricsGetAllDeliverErrorWeek added in v0.4.2

func (l *Logic) MetricsGetAllDeliverErrorWeek(ctx context.Context, days int) (map[*models.Instance]logic.MetricsDataPointsTime, error)

func (*Logic) MetricsGetAllDeliverSuccessWeek added in v0.4.2

func (l *Logic) MetricsGetAllDeliverSuccessWeek(ctx context.Context, days int) (map[*models.Instance]logic.MetricsDataPointsTime, error)

func (*Logic) MetricsGetAllReceivedWeek added in v0.4.2

func (l *Logic) MetricsGetAllReceivedWeek(ctx context.Context, days int) (map[*models.Instance]logic.MetricsDataPointsTime, error)

func (*Logic) MetricsGetDeliverErrorWeek added in v0.4.0

func (l *Logic) MetricsGetDeliverErrorWeek(ctx context.Context, days int, instanceID int64) (logic.MetricsDataPointsTime, error)

func (*Logic) MetricsGetDeliverSuccessWeek added in v0.4.0

func (l *Logic) MetricsGetDeliverSuccessWeek(ctx context.Context, days int, instanceID int64) (logic.MetricsDataPointsTime, error)

func (*Logic) MetricsGetReceivedTotalWeek added in v0.4.1

func (l *Logic) MetricsGetReceivedTotalWeek(ctx context.Context, days int) (logic.MetricsDataPointsTime, error)

func (*Logic) MetricsGetReceivedWeek added in v0.4.0

func (l *Logic) MetricsGetReceivedWeek(ctx context.Context, days int, instanceID int64) (logic.MetricsDataPointsTime, error)

func (*Logic) MetricsIncDeliverError added in v0.4.0

func (l *Logic) MetricsIncDeliverError(ctx context.Context, instanceID int64)

func (*Logic) MetricsIncDeliverSuccess added in v0.4.0

func (l *Logic) MetricsIncDeliverSuccess(ctx context.Context, instanceID int64)

func (*Logic) MetricsIncReceived added in v0.4.0

func (l *Logic) MetricsIncReceived(ctx context.Context, instanceID int64)

func (*Logic) ProcessActivity

func (l *Logic) ProcessActivity(ctx context.Context, jid string, instanceID int64, actorIRI *url.URL, activity fedihelper.Activity) error

func (*Logic) ProcessBlockAdd

func (l *Logic) ProcessBlockAdd(ctx context.Context, blockID int64) error

func (*Logic) ProcessBlockDelete

func (l *Logic) ProcessBlockDelete(ctx context.Context, blockID int64) error

func (*Logic) ProcessBlockUpdate

func (l *Logic) ProcessBlockUpdate(ctx context.Context, blockID int64) error

func (*Logic) ProcessConfigChanges

func (l *Logic) ProcessConfigChanges(ctx context.Context, configChanges []*models.ConfigChange) error

func (*Logic) ReadInstanceByToken added in v0.7.0

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

func (*Logic) RunSchedulerJob added in v0.7.0

func (l *Logic) RunSchedulerJob(job string) error

func (*Logic) SendNotification added in v0.2.0

func (l *Logic) SendNotification(ctx context.Context, jid string, event models.EventType, metadata map[string]interface{}) error

func (*Logic) SetFedi

func (l *Logic) SetFedi(f *fedi.Module)

func (*Logic) SetNotifier added in v0.2.0

func (l *Logic) SetNotifier(n notification.Notifier)

func (*Logic) SetRunner

func (l *Logic) SetRunner(r runner.Runner)

func (*Logic) SetScheduler added in v0.6.0

func (l *Logic) SetScheduler(s *scheduler.Module)

func (*Logic) Transport

func (l *Logic) Transport() *fedihelper.Transport

func (*Logic) UpdateAccountInfo added in v0.7.0

func (l *Logic) UpdateAccountInfo(ctx context.Context, jid string, accountID int64) error

func (*Logic) UpdateBlock

func (l *Logic) UpdateBlock(
	ctx context.Context,
	account *models.Account,
	changes []models.LogEntryBlockUpdateChange,
	block *models.Block,
) error

func (*Logic) UpdateInstanceInfo added in v0.7.0

func (l *Logic) UpdateInstanceInfo(ctx context.Context, jid string, instanceID int64) error

func (*Logic) ValidateRequest

func (l *Logic) ValidateRequest(r *nethttp.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