ResourceCache.Source behaviour (Resource Cache v0.0.4) View Source

Link to this section Summary

Link to this section Types

Specs

fingerprint() :: term()

Link to this section Callbacks

Specs

__type__() :: :cache | :source | :bridge
Link to this callback

fingerprint(cache, opts)

View Source

Specs

fingerprint(cache :: module(), opts :: Keyword.t()) :: term()
Link to this callback

init(cache, fingerprint, opts)

View Source

Specs

init(cache :: module(), fingerprint :: fingerprint(), opts :: Keyword.t()) ::
  :ok | {:error, atom()}
Link to this callback

list(state, allow_cached?)

View Source

Specs

list(state :: term(), allow_cached? :: boolean()) :: [term()]

Specs

primary(fingerprint :: fingerprint()) :: atom() | nil
Link to this callback

release(cache, fingerprint)

View Source

Specs

release(cache :: module(), fingerprint :: fingerprint()) ::
  :ok | {:error, atom()}