inbox

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package inbox creates and processes activities.

Incoming activities are received and queued by [fed.Listener].

Index

Constants

This section is empty.

Variables

View Source
var ErrActivityTooNested = errors.New("exceeded activity depth limit")
View Source
var ErrDeliveryQueueFull = errors.New("delivery queue is full")

Functions

This section is empty.

Types

type FeedUpdater

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

func (FeedUpdater) Run

func (u FeedUpdater) Run(ctx context.Context) error

type Inbox added in v0.19.0

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

func (*Inbox) Accept added in v0.19.0

func (inbox *Inbox) Accept(ctx context.Context, followed *ap.Actor, key httpsig.Key, follower, followID string, tx *sql.Tx) error

Accept queues an Accept activity for delivery.

func (*Inbox) Announce added in v0.19.0

func (inbox *Inbox) Announce(ctx context.Context, tx *sql.Tx, actor *ap.Actor, key httpsig.Key, note *ap.Object) error

Announce queues an Announce activity for delivery.

func (*Inbox) Create added in v0.19.0

func (inbox *Inbox) Create(ctx context.Context, cfg *cfg.Config, post *ap.Object, author *ap.Actor, key httpsig.Key) error

Create queues a Create activity for delivery.

func (*Inbox) Delete added in v0.19.0

func (inbox *Inbox) Delete(ctx context.Context, actor *ap.Actor, key httpsig.Key, note *ap.Object) error

Delete queues a Delete activity for delivery.

func (*Inbox) Follow added in v0.19.0

func (inbox *Inbox) Follow(ctx context.Context, follower *ap.Actor, key httpsig.Key, followed string) error

Follow queues a Follow activity for delivery.

func (*Inbox) Move added in v0.19.0

func (inbox *Inbox) Move(ctx context.Context, from *ap.Actor, key httpsig.Key, to string) error

Move queues a Move activity for delivery.

func (*Inbox) NewID added in v0.19.0

func (inbox *Inbox) NewID(actorID, prefix string) (string, error)

NewID generates a pseudo-random ID.

func (*Inbox) ProcessActivity added in v0.19.0

func (inbox *Inbox) ProcessActivity(ctx context.Context, tx *sql.Tx, path sql.NullString, sender *ap.Actor, activity *ap.Activity, rawActivity string, depth int, shared bool) error

func (*Inbox) Reject added in v0.19.0

func (inbox *Inbox) Reject(ctx context.Context, followed *ap.Actor, key httpsig.Key, follower, followID string, tx *sql.Tx) error

Reject queues a Reject activity for delivery.

func (*Inbox) Undo added in v0.19.0

func (inbox *Inbox) Undo(ctx context.Context, actor *ap.Actor, key httpsig.Key, activity *ap.Activity) error

Undo queues an Undo activity for delivery.

func (*Inbox) Unfollow added in v0.19.0

func (inbox *Inbox) Unfollow(ctx context.Context, follower *ap.Actor, key httpsig.Key, followed, followID string) error

Unfollow queues an Undo activity for delivery.

func (*Inbox) UpdateActor added in v0.19.0

func (inbox *Inbox) UpdateActor(ctx context.Context, actor *ap.Actor, key httpsig.Key) error

UpdateActor queues an Update activity for delivery.

func (*Inbox) UpdateActorTx added in v0.19.0

func (inbox *Inbox) UpdateActorTx(ctx context.Context, tx *sql.Tx, actor *ap.Actor, key httpsig.Key) error

UpdateActorTx queues an Update activity for delivery.

func (*Inbox) UpdateNote added in v0.19.0

func (inbox *Inbox) UpdateNote(ctx context.Context, actor *ap.Actor, key httpsig.Key, note *ap.Object) error

UpdateNote queues an Update activity for delivery.

type Queue

type Queue struct {
	Domain   string
	Config   *cfg.Config
	DB       *sql.DB
	Inbox    ap.Inbox
	Resolver ap.Resolver
	Keys     [2]httpsig.Key
}

func (*Queue) Process

func (q *Queue) Process(ctx context.Context) error

Process polls the queue of incoming activities and processes them.

func (*Queue) ProcessBatch

func (q *Queue) ProcessBatch(ctx context.Context) (int, error)

ProcessBatch processes one batch of incoming activites in the queue.

Directories

Path Synopsis
Package note handles insertion of posts.
Package note handles insertion of posts.

Jump to

Keyboard shortcuts

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