Documentation
¶
Overview ¶
Copyright 2025 Dima Krasner
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package outbox handles user actions and translates them into outgoing activities.
Outgoing activities are queued and delivered by [fed.Queue].
Index ¶
- Variables
- func Accept(ctx context.Context, domain string, followed, follower, followID string, ...) error
- func Announce(ctx context.Context, domain string, tx *sql.Tx, actor *ap.Actor, ...) error
- func Create(ctx context.Context, domain string, cfg *cfg.Config, db *sql.DB, ...) error
- func Delete(ctx context.Context, domain string, cfg *cfg.Config, db *sql.DB, ...) error
- func Follow(ctx context.Context, domain string, follower *ap.Actor, followed string, ...) error
- func ForwardActivity(ctx context.Context, domain string, cfg *cfg.Config, tx *sql.Tx, ...) error
- func Move(ctx context.Context, db *sql.DB, domain string, from *ap.Actor, to string) error
- func NewID(domain, prefix string) (string, error)
- func Reject(ctx context.Context, domain string, followed, follower, followID string, ...) error
- func Undo(ctx context.Context, domain string, db *sql.DB, activity *ap.Activity) error
- func Unfollow(ctx context.Context, domain string, db *sql.DB, ...) error
- func UpdateActor(ctx context.Context, domain string, tx *sql.Tx, actorID string) error
- func UpdateNote(ctx context.Context, domain string, cfg *cfg.Config, db *sql.DB, ...) error
- type Deleter
- type Mover
- type Poller
Constants ¶
This section is empty.
Variables ¶
var ErrDeliveryQueueFull = errors.New("delivery queue is full")
Functions ¶
func Accept ¶
func Accept(ctx context.Context, domain string, followed, follower, followID string, tx *sql.Tx) 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 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(ctx context.Context, domain string, cfg *cfg.Config, tx *sql.Tx, note *ap.Object, activity *ap.Activity, rawActivity string) 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 Reject ¶
func Reject(ctx context.Context, domain string, followed, follower, followID string, tx *sql.Tx) error
Reject queues a Reject activity for delivery.
func Unfollow ¶
func Unfollow(ctx context.Context, domain string, db *sql.DB, follower, followed, followID string) error
Unfollow queues an Undo activity for delivery.
func UpdateActor ¶
UpdateActor queues an Update activity for delivery.