Liking cljdoc? Tell your friends :D

clj-rate-limiter.core


mills->nanosclj

(mills->nanos m)
source

nanos->millsclj

(nanos->mills n)
source

rate-limiter-factoryclj

(rate-limiter-factory type & {:as opts})

Returns a rate limiter factory by type and options. Valid type includes :memory and :redis, for example: ;;Max 100 requests in 1 seconds. (def rt (rate-limiter-factory :memory :interval 1000 :max-in-interval 100))

Returns a rate limiter factory by type and options.
Valid type includes :memory and :redis, for example:
   ;;Max 100 requests in 1 seconds.
   (def rt (rate-limiter-factory :memory
                                 :interval 1000
                                 :max-in-interval 100))
sourceraw docstring

RateLimitercljprotocol

Rate limiter for clojure.

Rate limiter for clojure.

allow?clj

(allow? this id)

Return true if the request can be allowd by rate limiter.

Return true if the request can be allowd by rate limiter.

permit?clj

(permit? this id)

Return {:result true} if the request can be permited by rate limiter, Otherwise returns {:result false :current requests}.

Return {:result true} if the request
can be permited by rate limiter,
Otherwise returns {:result false :current requests}.

remove-permitclj

(remove-permit this id ts)

Remove the permit by id and permit timestamp.

Remove the permit by id and permit timestamp.
sourceraw docstring

RateLimiterFactorycljprotocol

A factory to create RateLimiter

A factory to create RateLimiter

createclj

(create this)

Return an RateLimiter instance.

Return an RateLimiter instance.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close