Apq.CacheProvider behaviour (Apq v2.0.0) View Source

Behaviour that the apq cache needs to conform to.

Link to this section Summary

Callbacks

Get a query document given a hash from the cache

Put a query document in the cache with the hex-encoded sha256-hash as cache key

Link to this section Types

Specs

hash() :: String.t()

Specs

query_doc() :: String.t()

Link to this section Callbacks

Specs

get(hash()) :: {:ok, query_doc()} | {:error, nil}

Get a query document given a hash from the cache

Specs

put(hash(), query_doc()) :: {:ok | :error, boolean()}

Put a query document in the cache with the hex-encoded sha256-hash as cache key