CertMagex.Storage.Backend behaviour (CertMagex v1.4.0)

Copy Markdown View Source

Behaviour for a CertMagex storage backend.

child/0 returns a supervisor child (or :ignore if the backend needs no process). The other callbacks read/write/delete arbitrary Erlang-term keys and values (CertMagex uses binaries like "ec.key" and tuples like {:acmev2, key}, {:cache, domain}, {:last_request, domain}).

Summary

Types

key()

@type key() :: term()

value()

@type value() :: term()

Callbacks

child()

@callback child() :: :supervisor.child_spec() | {module(), term()} | module() | :ignore

delete(key)

@callback delete(key()) :: any()

insert(key, value)

@callback insert(key(), value()) :: :ok

lookup(key)

@callback lookup(key()) :: value() | nil