(compute-limits limit-fns request ctx)
Inputs: [limit-fns :- [LimitFunction] request :- HttpRequest ctx] Returns: [Limit]
Inputs: [limit-fns :- [LimitFunction] request :- HttpRequest ctx] Returns: [Limit]
(first-reached-limit limits)
Inputs: [limits :- [Limit]] Returns: (s/maybe Limit)
Inputs: [limits :- [Limit]] Returns: (s/maybe Limit)
(header-limit n header name-in-headers)
Inputs: [n header name-in-headers] Returns: LimitFunction
Inputs: [n header name-in-headers] Returns: LimitFunction
(rate-limit-headers {:keys [turnstile nb-request-per-hour name-in-headers]})
Inputs: [{:keys [turnstile nb-request-per-hour name-in-headers]} :- Limit]
Inputs: [{:keys [turnstile nb-request-per-hour name-in-headers]} :- Limit]
(rate-limited? {:keys [turnstile nb-request-per-hour]})
Inputs: [{:keys [turnstile nb-request-per-hour]} :- Limit] Returns: s/Bool
Inputs: [{:keys [turnstile nb-request-per-hour]} :- Limit] Returns: s/Bool
(with-turnstile {:keys [rate-limit-key] :as limit}
{:keys [redis-conn key-prefix] :as ctx})
Inputs: [{:keys [rate-limit-key], :as limit} :- Limit {:keys [redis-conn key-prefix], :as ctx}] Returns: Limit
Inputs: [{:keys [rate-limit-key], :as limit} :- Limit {:keys [redis-conn key-prefix], :as ctx}] Returns: Limit
(wrap-rate-limit handler
{:keys [redis-conn limit-fns rate-limit-handler key-prefix]
:or {rate-limit-handler default-rate-limit-handler
key-prefix ""}
:as conf})
Middleware for the turnstile rate limiting service
Middleware for the turnstile rate limiting service
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close