VatchexVies.Cache protocol (VatchexVies v1.0.0)

Copy Markdown View Source

Protocol for cache adapters used by VatchexVies.lookup/3.

Summary

Types

t()

All the types that implement this protocol.

Functions

Looks up a cached value by key. Returns {:ok, value} or :miss.

Stores a value in the cache. The opts keyword list may include

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

get(cache, key)

Looks up a cached value by key. Returns {:ok, value} or :miss.

put(cache, key, value, opts)

Stores a value in the cache. The opts keyword list may include:

  • :ttl — time-to-live in milliseconds (adapter may fall back to its own default or app config)