Documentation
¶
Index ¶
- func SignRequest(actor Actor) remote.Option
- type Actor
- func (actor *Actor) ActorID() string
- func (actor *Actor) Send(message mapof.Any, recipients ...iter.Seq[string])
- func (actor *Actor) SendAccept(acceptID string, activity streams.Document)
- func (actor *Actor) SendAnnounce(announceID string, object streams.Document)
- func (actor *Actor) SendCreate(document streams.Document)
- func (actor *Actor) SendDelete(document streams.Document)
- func (actor *Actor) SendDislike(dislikeID string, object streams.Document)
- func (actor *Actor) SendFollow(followID string, remoteActorID string)
- func (actor *Actor) SendLike(likeID string, object streams.Document)
- func (actor *Actor) SendOne(recipientID string, message mapof.Any) error
- func (actor *Actor) SendUndo(activity streams.Document)
- func (actor *Actor) SendUpdate(document streams.Document)
- func (actor *Actor) With(options ...ActorOption)
- type ActorOption
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, sending it to all recipients in the iterator. 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) 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) SendDislike ¶ added in v0.13.0
SendDislike sends an "Dislike" message to the recipient activity: The activity that is being announced
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) SendLike ¶ added in v0.13.0
SendLike sends an "Like" message to the recipient activity: The activity that is being announced
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 iter.Seq[string]) ActorOption
func WithPublicKey ¶
func WithPublicKey(publicKeyID string) ActorOption
WithPublicKey is an ActorOption that sets the public key for an Actor