VatchexGreece.Cache protocol (VatchexGreece v1.2.0)

Copy Markdown View Source

Protocol for cache adapters used by VatchexGreece.fetch/2.

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 with a TTL in milliseconds.

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, ttl)

Stores a value in the cache with a TTL in milliseconds.