camarero v0.6.2 Camarero.Plato behaviour View Source
This behaviour is high-level abstraction of the container begind handlers.
Aññ handlers are supposed to implement this behaviour. The simplest way
is to use Camarero.Plato
in the handler module; that will inject
the default boilerlate using %{binary() => any()}
map as a container behind.
Default implementation uses Camarero.Tapas
as low-level container implementation.
Link to this section Summary
Callbacks
Returns the container itself, as is
Deletes the key-value pair for the key specified
Returns the value for the key specified
Sets the value for the key specified (intended to be used from the application)
Returns the route this module is supposed to be mounted to
Link to this section Callbacks
plato_all()
View Source
plato_all() :: Camarero.Tapas.t()
plato_all() :: Camarero.Tapas.t()
Returns the container itself, as is
plato_delete(key) View Source
Deletes the key-value pair for the key specified
plato_get(key)
View Source
plato_get(key :: binary() | atom()) ::
{:ok, any()} | :error | {:error, {400 | 404 | non_neg_integer(), map()}}
plato_get(key :: binary() | atom()) :: {:ok, any()} | :error | {:error, {400 | 404 | non_neg_integer(), map()}}
Returns the value for the key specified
plato_put(key, value) View Source
Sets the value for the key specified (intended to be used from the application)
plato_route()
View Source
plato_route() :: binary()
plato_route() :: binary()
Returns the route this module is supposed to be mounted to