hammer v1.0.0 Hammer.Backend behaviour View Source

The backend Behaviour module

Link to this section Summary

Link to this section Callbacks

Link to this callback count_hit(key, now) View Source
count_hit(key :: {bucket :: integer, id :: String.t}, now :: integer) ::
  {:ok, count :: integer} |
  {:error, reason :: any}
Link to this callback delete_buckets(id) View Source
delete_buckets(id :: String.t) ::
  {:ok, count_deleted :: integer} |
  {:error, reason :: any}
Link to this callback get_bucket(key) View Source
get_bucket(key :: {bucket :: integer, id :: String.t}) ::
  {:ok, {key :: {bucket :: integer, id :: String.t}, count :: integer, created :: integer, updated :: integer}} |
  {:ok, nil} |
  {:error, reason :: any}