View Source ActivityPub.Federator.Publisher behaviour (Bonfire v0.9.10-classic-beta.169)

Defines the contract used by federation implementations to publish messages to their peers.

TODO: why not use APPublisher directly instead?

Summary

Callbacks

Gathers links used by an outgoing federation module for WebFinger output.

Determine whether an activity can be relayed using the federation module.

Relays an activity to all specified peers.

Relays an activity to a specified peer, determined by the parameters. The parameters used are controlled by the federation module.

Callbacks

Link to this callback

gather_webfinger_links(t)

View Source
@callback gather_webfinger_links(Map.t()) :: list()

Gathers links used by an outgoing federation module for WebFinger output.

@callback is_representable?(Map.t()) :: boolean()

Determine whether an activity can be relayed using the federation module.

@callback publish(Map.t(), Map.t()) :: :ok | {:error, any()}

Relays an activity to all specified peers.

@callback publish_one(Map.t()) :: {:ok, Map.t()} | {:error, any()}

Relays an activity to a specified peer, determined by the parameters. The parameters used are controlled by the federation module.

Functions

Link to this function

enqueue_one(module, params)

View Source
@spec enqueue_one(module(), Map.t()) :: :ok

Enqueue publishing a single activity.

Link to this function

gather_webfinger_links(user)

View Source
@spec gather_webfinger_links(Map.t()) :: list()
@spec publish(Map.t(), Map.t()) :: :ok