Documentation
¶
Overview ¶
Package sender provides an object and queue consumer that can send outbound ActivityPub activities from an outbox to actor's inbox URLs. It automatically signs activities using the sending actor's private key.
Index ¶
Constants ¶
const OutboxSendToAllRecipients = "Outbox:SendToAllRecipients"
OutboxSendToAllRecipients is the name of the task that scans an outbound ActivityPub activity for recipients' inbox URLs, then queues additional tasks to send that activity to each recipient
const OutboxSendToSingleRecipient = "Outbox:SendToSingleRecipient"
OutboxSendToSingleRecipient is the name of the task that sends an outbound ActivityPub activity to a single recipient.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Actor ¶
type Actor interface {
// ActorID returns the unique ID (URL) of this Actor
ActorID() string
// PrivateKey returns a PrivateKeyID and PrivateKey to use for
// signing outbound ActivityPub messages from this Actor
PrivateKey() (privateKeyID string, privateKey crypto.PrivateKey)
}
Actor defines the interface for an ActivityPub Actor Actors must be addressable https://www.w3.org/TR/activitypub/#actors
type Locator ¶
type Locator interface {
// Actor retrieves a single Actor by its URL.
Actor(url string) (Actor, error)
// Recipients a RangeFunc iterator that containing the
// inbox URLs for every actor that is addressed by
// the provided URLs.
// This method should look up individual actors, as well
// as collections (such as Followers, Circles, etc.)
// This method is not expected to de-duplicate inbox adddresses;
// this action will be performed by the Outbox itself.
Recipient(url string) (iter.Seq[string], error)
}
Locator defines a service that can locate ActivityPub actors and collections based on their URLs
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender manages delivery of outbound activities from the outbox, using the turbind Queue to deliver activities asynchronously. This object can be used on its own, or it can be embedded in the HTTPPoster object to automatically send activities when they are POST-ed to the outbox.
func (Sender) Send ¶
Send queues a new task to deliver the provided activity to all recipients. IMPORTANT: The queue.Consumer in this package MUST be connected to a live queue process in order for outbound activities to be sent.
func (*Sender) SendToAllRecipients ¶ added in v0.15.1
SendToAllRecipients sends a single ActivityPub activity from a the provided Actor to a single recipient's inbox URL.