Documentation
¶
Overview ¶
Package fixedwindow implements the Fixed Window rate limiting algorithm.
Time is partitioned into discrete fixed windows (e.g., every 1 minute). A counter is incremented for each incoming request and resets to zero at the boundary of a new window.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Strategy ¶
type Strategy struct{}
Strategy implements the algorithm.Algorithm interface for Fixed Window.
func (*Strategy) EvaluateMemory ¶
func (s *Strategy) EvaluateMemory(now time.Time, state *algorithm.State, limit int64, window time.Duration) algorithm.Result
EvaluateMemory evaluates the fixed window rate limit state synchronously in RAM.
func (*Strategy) RedisScript ¶
RedisScript returns the high-performance atomic Lua script utilizing Redis INCR.
Click to show internal directories.
Click to hide internal directories.