Discover Packages
github.com/Caua-ferraz/AgentGuard
pkg
ratelimit
package
Version:
v0.3.0
Opens a new window with list of versions in this module.
Published: Mar 30, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
ParseWindow converts a window string like "1m", "30s", "1h" to a Duration.
Limiter implements a token-bucket rate limiter keyed by scope and agent.
New creates a new rate limiter.
Allow checks whether a request identified by key is within the rate limit.
maxRequests is the maximum number of requests allowed in the given window.
Returns nil if allowed, or an error describing the limit.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.