View Source Avrora.Storage.Transient behaviour (avrora v0.30.1)

Storage behavior which allows keys to be removed or expired.

Summary

Types

Naive timestamp with second precision.

Types

timestamp()

@type timestamp() :: timeout()

Naive timestamp with second precision.

Callbacks

delete(key)

@callback delete(key :: Avrora.Storage.schema_id()) ::
  {:ok, result :: boolean()} | {:error, reason :: term()}

expire(key, ttl)

@callback expire(key :: Avrora.Storage.schema_id(), ttl :: timeout()) ::
  {:ok, timestamp :: timestamp()} | {:error, reason :: term()}

flush()

@callback flush() :: {:ok, result :: boolean()} | {:error, reason :: term()}