Astarte.Flow.Blocks.JsonPathMapper (astarte_flow v0.1.0)

Transforms the incoming JSON message using the configured JSON template which makes use of JSONPath to extract data from the incoming message.

Link to this section Summary

Functions

Transforms the given message according to the configured template.

Starts the JsonPathMapper.

Link to this section Functions

Link to this function

json_path_transform(msg, config)

@spec json_path_transform(
  Astarte.Flow.Message.t(),
  Astarte.Flow.Blocks.JsonPathMapper.Config.t()
) :: {:ok, Astarte.Flow.Message.t()} | {:error, any()}

Transforms the given message according to the configured template.

Link to this function

start_link(opts)

@spec start_link([Astarte.Flow.Blocks.JsonPathMapper.Config.option()]) ::
  GenServer.on_start()

Starts the JsonPathMapper.

options

Options

  • :template - output message template. It must be a valid JSON that makes use of JSONPath.