Yggdrasil v5.0.0 Yggdrasil.Transformer.Json View Source
JSON Yggdrasil transformer using the library Jason
.
Link to this section Summary
Link to this section Functions
Link to this function
child_spec(arg) View Source
Returns a specification to start this module under a supervisor.
arg
is passed as the argument to Task.start_link/1
in the :start
field
of the spec.
For more information, see the Supervisor
module,
the Supervisor.child_spec/2
function and the Supervisor.child_spec/0
type.
Link to this function
decode(channel, message)
View Source
decode(channel, message)
View Source
decode(Yggdrasil.Channel.t(), term()) :: {:ok, term()} | {:error, term()}
decode(Yggdrasil.Channel.t(), binary()) :: {:ok, map()} | {:error, term()}
decode(Yggdrasil.Channel.t(), term()) :: {:ok, term()} | {:error, term()}
decode(Yggdrasil.Channel.t(), binary()) :: {:ok, map()} | {:error, term()}
Decodes a JSON from a binary message
. The channel
is ignored.
Link to this function
encode(channel, message)
View Source
encode(channel, message)
View Source
encode(Yggdrasil.Channel.t(), term()) :: {:ok, term()} | {:error, term()}
encode(Yggdrasil.Channel.t(), binary()) :: {:ok, binary()} | {:error, term()}
encode(Yggdrasil.Channel.t(), term()) :: {:ok, term()} | {:error, term()}
encode(Yggdrasil.Channel.t(), binary()) :: {:ok, binary()} | {:error, term()}
Encodes some data
to a JSON binary. The channel
is ignored.
Link to this function
register()
View Source
register()
View Source
register() :: :ok
register() :: :ok
Registers transformer in Registry
.
Link to this function
start_link(_) View Source
Start task to register the transformer in the Registry
.