Pow v1.0.20 Pow.Store.Base behaviour View Source

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

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this function

put(config, backend_config, record_or_records)

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

Link to this section Callbacks

Link to this callback

all(config, key_match)

View Source
all(config(), key_match()) :: [record()]
Link to this callback

delete(config, key)

View Source
delete(config(), key()) :: :ok
Link to this callback

get(config, key)

View Source
get(config(), key()) :: any() | :not_found
Link to this callback

put(config, key, any)

View Source
put(config(), key(), any()) :: :ok