Documentation
¶
Overview ¶
Package fixedwindow implements a fixed-window counter rate limiter backed by Valkey. Requests are counted within discrete time windows; the counter resets when the window expires.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Limit int64 // maximum requests per window
Window time.Duration // window duration
KeyPrefix string // Valkey key prefix
Timeout time.Duration // per-operation Valkey timeout
}
Config defines the parameters for a fixed-window rate limiter.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults for general use.
Click to show internal directories.
Click to hide internal directories.