View Source ActivityPubWeb.Federator.Publisher behaviour (bonfire v0.3.5-classic-beta.7)

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

Link to this section 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.

Link to this section 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.

Link to this section 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