outbox

package
v0.0.0-...-0923612 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package outbox handles user actions and translates them into outgoing activities.

Outgoing activities are queued and delivered by [fed.Queue].

Index

Constants

This section is empty.

Variables

View Source
var ErrDeliveryQueueFull = errors.New("delivery queue is full")

Functions

func Accept

func Accept(ctx context.Context, domain string, followed, follower, followID string, db *sql.DB) error

Accept queues an Accept activity for delivery.

func Announce

func Announce(ctx context.Context, domain string, tx *sql.Tx, actor *ap.Actor, note *ap.Object) error

Announce queues an Announce activity for delivery.

func Create

func Create(ctx context.Context, domain string, cfg *cfg.Config, db *sql.DB, post *ap.Object, author *ap.Actor) error

Create queues a Create activity for delivery.

func Delete

func Delete(ctx context.Context, domain string, cfg *cfg.Config, db *sql.DB, note *ap.Object) error

Delete queues a Delete activity for delivery.

func Follow

func Follow(ctx context.Context, domain string, follower *ap.Actor, followed string, db *sql.DB) error

Follow queues a Follow activity for delivery.

func ForwardActivity

func ForwardActivity[T ap.RawActivity](ctx context.Context, domain string, cfg *cfg.Config, tx *sql.Tx, note *ap.Object, activity *ap.Activity, rawActivity T) error

ForwardActivity forwards an activity if needed. A reply by B in a thread started by A is forwarded to all followers of A. A post by a follower of a local group, which mentions the group or replies to a post in the group, is forwarded to followers of the group.

func Move

func Move(ctx context.Context, db *sql.DB, domain string, from *ap.Actor, to string) error

Move queues a Move activity for delivery.

func Undo

func Undo(ctx context.Context, domain string, db *sql.DB, activity *ap.Activity) error

Undo queues an Undo activity for delivery.

func Unfollow

func Unfollow(ctx context.Context, domain string, db *sql.DB, follower, followed, followID string) error

Unfollow queues an Unfollow activity for delivery.

func UpdateActor

func UpdateActor(ctx context.Context, domain string, tx *sql.Tx, actorID string) error

UpdateActor queues an Update activity for delivery.

func UpdateNote

func UpdateNote(ctx context.Context, domain string, cfg *cfg.Config, db *sql.DB, note *ap.Object) error

UpdateNote queues an Update activity for delivery.

Types

type Mover

type Mover struct {
	Domain   string
	DB       *sql.DB
	Resolver ap.Resolver
	Key      httpsig.Key
}

func (*Mover) Run

func (m *Mover) Run(ctx context.Context) error

Run makes users who follow a moved account follow the target account instead. It queues two activites for delivery: an Unfollow activity for the old account and a Follow activity for the new one.

type Poller

type Poller struct {
	Domain string
	Config *cfg.Config
	DB     *sql.DB
}

func (*Poller) Run

func (p *Poller) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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