Documentation ¶
Index ¶
- func MakeUndo(actorID string, activity mapof.Any) mapof.Any
- func SignRequest(actor Actor) remote.Option
- type Actor
- func (actor *Actor) ActorID() string
- func (actor *Actor) Send(message mapof.Any)
- func (actor *Actor) SendAccept(acceptID string, activity streams.Document)
- func (actor *Actor) SendActivity(activityType string, object streams.Document)
- func (actor *Actor) SendAnnounce(announceID string, activity streams.Document)
- func (actor *Actor) SendCreate(activity mapof.Any)
- func (actor *Actor) SendDelete(activity streams.Document)
- func (actor *Actor) SendFollow(followID string, remoteActorID string)
- func (actor *Actor) SendUndo(activity streams.Document)
- func (actor *Actor) SendUpdate(activity streams.Document)
- func (actor *Actor) With(options ...ActorOption)
- type ActorOption
- type SendTask
- type Uniquer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignRequest ¶
SignRequest is a middleware for the remote package that adds an HTTP Signature to a request.
Types ¶
type Actor ¶
type Actor struct {
// contains filtered or unexported fields
}
Actor represents an ActivityPub actor that can send ActivityPub messages https://www.w3.org/TR/activitypub/#actors
func NewActor ¶
func NewActor(actorID string, privateKey crypto.PrivateKey, options ...ActorOption) Actor
NewActor returns a fully initialized Actor object, and applies optional settings as provided
func (*Actor) Send ¶
Send pushes a message onto the outbound queue. This currently uses the To and CC fields, but not BTo and BCC. https://www.w3.org/TR/activitypub/#delivery
func (*Actor) SendAccept ¶
SendAccept sends an "Accept" message to the recipient actor: The Actor that is sending the request activity: The activity that has been accepted (likely a "Follow" request)
func (*Actor) SendActivity ¶
SendActivity wraps a document in a standard ActivityStream envelope and sends it to the target. actor: The Actor that is sending the request activityType: The type of activity to send (e.g. "Create", "Update", "Accept", etc) object: The object of the activity (e.g. the post that is being created, updated, etc) recipient: The ActivityStream profile of the message recipient
func (*Actor) SendAnnounce ¶
SendAccept sends an "Announce" message to the recipient activity: The activity that is being announced
func (*Actor) SendCreate ¶
SendCreate sends an "Create" message to the recipient actor: The Actor that is sending the request activity: The activity that has been created (such as a "Note" or "Article") recipient: The profile of the message recipient
func (*Actor) SendDelete ¶
SendDelete sends an "Delete" message to the recipient actor: The Actor that is sending the request activity: The activity that has been deleted recipient: The ActivityStream profile of the message recipient
func (*Actor) SendFollow ¶
SendFollow sends a "Follow" request to the recipient actor: The Actor that is sending the request followID: The unique ID of this request recipient: The ActivityStream profile of the Actor that is being followed
func (*Actor) SendUndo ¶
SendUndo sends an "Undo" message to the recipient actor: The Actor that is sending the request activity: The activity that has been undone recipient: The ActivityStream profile of the message recipient
func (*Actor) SendUpdate ¶
SendUpdate sends an "Update" message to the recipient actor: The Actor that is sending the request activity: The activity that has been updated recipient: The ActivityStream profile of the message recipient
func (*Actor) With ¶
func (actor *Actor) With(options ...ActorOption)
With applies one or more options to an Actor
type ActorOption ¶
type ActorOption func(*Actor)
ActorOption is a function signature that modifies optional settings for an Actor
func WithClient ¶
func WithClient(client streams.Client) ActorOption
WithCliient is an ActorOption that sets the hanibal Client for an Actor
func WithFollowers ¶
func WithFollowers(followers <-chan string) ActorOption
func WithPublicKey ¶
func WithPublicKey(publicKeyID string) ActorOption
WithPublicKey is an ActorOption that sets the public key for an Actor
func WithQueue ¶
func WithQueue(queue queue.Queue) ActorOption
WithQueue is an ActorOption that sets the outbound Queue for an Actor
type SendTask ¶ added in v0.8.1
type SendTask struct {
// contains filtered or unexported fields
}
SendTask implements the queue.Task interface
func NewSendTask ¶ added in v0.8.1
NewSendTask returns a fully initialized SendTask object
type Uniquer ¶
type Uniquer[T comparable] struct { // contains filtered or unexported fields }
Uniquer is a utility class that helps to identify unique values
func NewUniquer ¶
func NewUniquer[T comparable]() *Uniquer[T]
NewUniquer returns a fully initialized Uniquer object
func (*Uniquer[T]) IsDuplicate ¶
IsDuplicate returns TRUE if the value has been seen before.