View Source Terrasol.Document.Format behaviour (Terrasol v2.0.0)

Behaviour for Document handler modules

Link to this section Summary

Callbacks

Build a struct from a supplied map using proper defaults

The "format" value which this module handles

Parse a map into a struct.

Link to this section Callbacks

@callback build(map()) :: map() | {:invalid, [atom()]}

Build a struct from a supplied map using proper defaults

Return {:invalid, [atoms for invalid supplied keys]}

@callback format_string() :: String.t()

The "format" value which this module handles

@callback parse(map()) :: map() | {:invalid, [atom()]}

Parse a map into a struct.

Return {:invalid, [atoms for unvalidatable keys]}