View Source Camarero.Tapas behaviour (camarero v1.0.3)
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.
Summary
Types
Camarero.Tapas
allows anything implementing Access
behaviour as a container
Callbacks
Deletes the key-value pair for the key specified from the container
Retrieves from the container and returns the value for the key specified
Returns the empty container to be used to store the data.
Sets the value for the key specified (intended to be used from the application)
Types
@type t() :: Access.t()
Camarero.Tapas
allows anything implementing Access
behaviour as a container
Callbacks
Deletes the key-value pair for the key specified from the container
Retrieves from the container and returns the value for the key specified
@callback tapas_into() :: t()
Returns the empty container to be used to store the data.
The returned term must implement Access
behaviour since it’d be used from CR[U]D
operations (tapas_get/2
, tapas_put/3
, and tapas_delete/2
).
Sets the value for the key specified (intended to be used from the application)