Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalRateLimiter ¶ added in v3.0.11
type GlobalRateLimiter struct { Limit int // Maximum number of requests allowed Freq int // Frequency window in seconds // contains filtered or unexported fields }
GlobalRateLimiter enforces global rate limits across all requests.
func NewGlobalRateLimiter ¶ added in v3.0.11
func NewGlobalRateLimiter(limit, freq int) *GlobalRateLimiter
NewGlobalRateLimiter creates a new instance of a global rate limiter.
type RateLimitTransport ¶ added in v3.0.11
type RateLimitTransport struct { Base http.RoundTripper Limiter *GlobalRateLimiter WaitFunc func() (bool, time.Duration) // Wait function reference Logger logger.Logger AdditionalDelay time.Duration // Optional constant delay }
RateLimitTransport wraps the HTTP transport to apply rate limiting.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(getLimit, postPutDeleteLimit, getFreq, postPutDeleteFreq int) *RateLimiter
Click to show internal directories.
Click to hide internal directories.