ExExample.Cache (ExExample v0.1.2)
View SourceI define logic to store and retrieve results from the cache.
Summary
Functions
I clear the entire cache.
I fetch a previous Result from the cache if it exists.
If it does not exist, I return {:error, :not_found}.
I store a result in cache for a given key.
I return the state of the last execution of an example.
Functions
@spec clear() :: :ok
I clear the entire cache.
@spec get_result(ExExample.Cache.Key.t()) :: {:ok, ExExample.Cache.Result.t()} | {:error, :no_result}
I fetch a previous Result from the cache if it exists.
If it does not exist, I return {:error, :not_found}.
@spec put_result(ExExample.Cache.Result.t(), ExExample.Cache.Key.t()) :: {atom(), boolean()}
I store a result in cache for a given key.
@spec state(ExExample.Cache.Key.t() | {atom(), atom()}) :: :succeeded | :failed | :skipped
I return the state of the last execution of an example.