IndieWeb.Cache.Adapter behaviour (IndieWeb v0.0.66) View Source

Interface presenting the adapter for caching values.

This provides the interface that adapters should implement if they'd like IndieWeb to use it for caching values. Check IndieWeb for more information and IndieWeb.Cache.Adapters.Cachex for more information.

Link to this section Summary

Callbacks

Defines the method of deleting a cached value.

Defines the method for obtaining a cached value.

Defines the method of setting of a cached value.

Link to this section Callbacks

Specs

delete(key :: binary()) :: :ok | :error

Defines the method of deleting a cached value.

Specs

get(key :: binary(), default_value :: any()) :: {:ok, any()} | {:error, any()}

Defines the method for obtaining a cached value.

Link to this callback

set(key, value, options)

View Source

Specs

set(key :: binary(), value :: any(), options :: keyword()) :: :ok | :error

Defines the method of setting of a cached value.