Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Limiter)
Option is a functional option for the limiter, see With* functions for reference
func WithInMemoryGCRA ¶
WithInMemoryGCRA allows to use the GCRA algorithm (in-memory) with the specified burst or with the burst as rate if the provided burst is <= 0
func WithRedisGCRA ¶
WithRedisGCRA allows to use the GCRA algorithm (Redis version) with the specified burst or with the burst as rate if the provided burst is <= 0
func WithRedisSortedSet ¶
func WithRedisSortedSet(rc *redis.Client) Option
WithRedisSortedSet allows to use the Redis SortedSet algorithm for rate limiting
func WithStatsCollector ¶
func WithStatsCollector(sc statsCollector) Option
WithStatsCollector allows to setup a stats collector for the limiter
Click to show internal directories.
Click to hide internal directories.