Documentation
¶
Overview ¶
Package ratelimit owns fixed-window rate-limit state and persistence.
Index ¶
Constants ¶
View Source
const ( // StorageSchemaVersion identifies the only rate-limit schema. StorageSchemaVersion = 1 // StoragePrefix is the rate-limit v1 namespace. StoragePrefix = "ratelimit:v1:subject:" )
Variables ¶
View Source
var ( // ErrRepositoryRequired reports an absent rate-limit storage adapter. ErrRepositoryRequired = errors.New("rate-limit storage is required") // ErrInvalidSubject reports an empty rate-limit identity. ErrInvalidSubject = errors.New("rate-limit subject is required") // ErrInvalidLimit reports a non-positive request limit. ErrInvalidLimit = errors.New("rate-limit limit must be positive") // ErrInvalidWindow reports a non-positive limit window. ErrInvalidWindow = errors.New("rate-limit window must be positive") // ErrConflict reports exhausted compare-and-swap attempts. ErrConflict = errors.New("rate-limit update conflict") // ErrCorruptRecord reports invalid durable rate-limit data. ErrCorruptRecord = errors.New("rate-limit record is invalid") )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.