Condukt.SessionStore behaviour (Condukt v0.16.5)

Copy Markdown View Source

Behaviour for persisting and restoring Condukt sessions.

Session stores receive the current session snapshot and decide how to persist it. Condukt ships with memory and disk-backed implementations, and callers can provide their own store modules.

Summary

Callbacks

clear(keyword)

@callback clear(keyword()) :: :ok | {:error, term()}

load(keyword)

@callback load(keyword()) :: {:ok, term()} | :not_found | {:error, term()}

save(term, keyword)

@callback save(
  term(),
  keyword()
) :: :ok | {:error, term()}

Functions

clear(store, default_opts \\ [])

load(store, default_opts \\ [])

save(store, snapshot, default_opts \\ [])