Apq v1.2.1 Apq.CacheProvider behaviour 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 | :error, query_doc() | 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