Astarte.Flow.Blocks.JsonPathMapper.JsonTemplate (astarte_flow v0.1.0)
Implements a simple logic less templating system that allows to write map templates with a syntax that resembles mustache syntax, that can be used for JSON templating.
Link to this section Summary
Link to this section Types
@opaque compiled_item()
@opaque compiled_template()
Link to this type
rendered_template()
@type rendered_template() :: template_base_type() | [rendered_template()] | %{optional(String.t()) => rendered_template()}
Link to this type
template()
@type template() :: template_base_type() | [template()] | %{optional(String.t()) => template()}
Link to this type
template_base_type()
Link to this section Functions
Link to this function
compile_template(template_list)
@spec compile_template(template()) :: {:ok, compiled_template()} | {:error, any()}
Link to this function
render(template, input)
@spec render(compiled_template(), any()) :: {:ok, rendered_template()} | {:error, any()}