2019-05-22 14:12:11 +02:00
|
|
|
defmodule Mobilizon.Service.ActivityPub.Converter do
|
|
|
|
@moduledoc """
|
|
|
|
Converter behaviour
|
|
|
|
|
|
|
|
This module allows to convert from ActivityStream format to our own internal one, and back
|
|
|
|
"""
|
|
|
|
@callback as_to_model_data(map()) :: map()
|
|
|
|
@callback model_to_as(struct()) :: map()
|
|
|
|
end
|
2019-07-30 16:40:59 +02:00
|
|
|
|
|
|
|
defprotocol Mobilizon.Service.ActivityPub.Convertible do
|
|
|
|
@type activitystreams :: map()
|
|
|
|
|
|
|
|
@spec model_to_as(t) :: activitystreams
|
|
|
|
def model_to_as(convertible)
|
|
|
|
end
|