hammer v5.0.0 Hammer.Backend behaviour View Source
The backend Behaviour module
Link to this section Summary
Link to this section Types
Link to this type
bucket_info()
View Source
bucket_info() :: {key :: bucket_key, count :: integer, created :: integer, updated :: integer}
Link to this section Callbacks
Link to this callback
count_hit(pid, key, now)
View Source
count_hit(pid :: pid, key :: bucket_key, now :: integer) :: {:ok, count :: integer} | {:error, reason :: any}
Link to this callback
count_hit(pid, key, now, increment)
View Source
count_hit(pid :: pid, key :: bucket_key, now :: integer, increment :: integer) :: {:ok, count :: integer} | {:error, reason :: any}
Link to this callback
delete_buckets(pid, id)
View Source
delete_buckets(pid :: pid, id :: String.t) :: {:ok, count_deleted :: integer} | {:error, reason :: any}
Link to this callback
get_bucket(pid, key)
View Source
get_bucket(pid :: pid, key :: bucket_key) :: {:ok, info :: bucket_info} | {:ok, nil} | {:error, reason :: any}