View Source Bonfire.Federate.ActivityPub.FederationModules behaviour (Bonfire v0.9.10-classic-beta.169)
A automatically-generated global list of federation modules which can queried by activity and/or object type.
To add a module to this list, you should declare @behaviour Bonfire.Federate.ActivityPub.FederationModules
in it and define a federation_module/0
function which returns a list of object and/or activity types which that module handles.
Example:
@behaviour Bonfire.Federate.ActivityPub.FederationModules
def federation_module,
do: [
"Announce",
{"Create", "Announce"},
{"Undo", "Announce"},
{"Delete", "Announce"}
]
You should also then implement these two functions:
- for outgoing federation:
ap_publish_activity(subject_struct, verb, object_struct)
- for incoming federation:
ap_receive_activity(subject_struct, activity_json, object_json)
Summary
Callbacks
Get a Federation Module identified by activity and/or object type, given a activity and/or object (string or {activity, object} tuple).
Functions
Look up a Federation Module, throw :not_found if not found.
Look up many types at once, throw :not_found if any of them are not found
Callback implementation for Bonfire.Common.ExtensionBehaviour.modules/0
.
Callbacks
@callback federation_module() :: any()
Get a Federation Module identified by activity and/or object type, given a activity and/or object (string or {activity, object} tuple).
Functions
federation_module(query, modules \\ federation_modules_data_types())
View Sourcefederation_module!(query, modules \\ federation_modules_data_types())
View SourceLook up a Federation Module, throw :not_found if not found.
Look up many types at once, throw :not_found if any of them are not found
Callback implementation for Bonfire.Common.ExtensionBehaviour.modules/0
.