View Source Pow.Store.Base behaviour (Pow v1.0.37)

Used to set up API for key-value stores.

Usage

defmodule MyApp.CustomCache do
  use Pow.Store.Base,
    ttl: :timer.minutes(30),
    namespace: "credentials"

  @impl true
  def put(config, key, value) do
    Pow.Store.Base.put(config, backend_config(config), {key, value})
  end
end

Summary

Types

Callbacks

@callback all(config(), key_match()) :: [record()]
@callback delete(config(), key()) :: :ok
@callback get(config(), key()) :: any() | :not_found
@callback put(config(), key(), any()) :: :ok

Functions

Link to this function

put(config, backend_config, record_or_records)

View Source
@spec put(config(), config(), record() | [record()]) :: :ok