Obscura.Vault.Backend behaviour (obscura v0.1.0)

Copy Markdown View Source

Behaviour for optional vault backends.

Obscura ships memory and ETS backends. Applications can use this behaviour as the contract for persistent backends without making Ecto or another storage dependency mandatory for Obscura.

Summary

Types

vault_ref()

@type vault_ref() :: GenServer.server()

Callbacks

handle_call(term, from, term)

@callback handle_call(term(), GenServer.from(), term()) ::
  {:reply, term(), term()} | {:reply, term(), term(), timeout() | :hibernate}

init(keyword)

@callback init(keyword()) :: {:ok, term()} | {:stop, term()}

start_link(keyword)

@callback start_link(keyword()) :: GenServer.on_start()