View Source ExKits.Cache.Storage behaviour (lib_oss v0.1.0)

storage behaviour, as backend of cache framework

you can use default implementation ExKits.Storage.ETS, or implement your own storage

Summary

Types

@type k() :: term()
@type opts() :: Keyword.t()
@type put_opts() :: [{:ttl, pos_integer() | :infinity}]
@type t() :: struct()
@type v() :: term() | nil

Callbacks

@callback del(t(), k()) :: any()
@callback get(t(), k()) :: v()
@callback new(opts()) :: t()
@callback put(t(), k(), v(), put_opts()) :: any()

Functions

@spec del(t(), k()) :: any()
@spec get(t(), k()) :: v()
Link to this function

put(storage, k, v, opts)

View Source
@spec put(t(), k(), v(), put_opts()) :: any()