Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRateLimiterMemoryStoreConfig = RateLimiterPersistentStoreConfig{ ExpiresIn: 3 * time.Minute, }
DefaultRateLimiterMemoryStoreConfig provides default configuration values for RateLimiterMemoryStore
Functions ¶
This section is empty.
Types ¶
type RateLimiterPersistentStore ¶
type RateLimiterPersistentStore struct {
// contains filtered or unexported fields
}
func NewRateLimiterPersistentStoreWithConfig ¶
func NewRateLimiterPersistentStoreWithConfig(config RateLimiterPersistentStoreConfig) (store *RateLimiterPersistentStore)
type RateLimiterPersistentStoreConfig ¶
type RateLimiterPersistentStoreConfig struct { Rate rate.Limit // Rate of requests allowed to pass as req/s. For more info check out Limiter docs - https://pkg.go.dev/golang.org/x/time/rate#Limit. Burst int // Burst is maximum number of requests to pass at the same moment. It additionally allows a number of requests to pass when rate limit is reached. ExpiresIn time.Duration // ExpiresIn is the duration after that a rate limiter is cleaned up }
RateLimiterPersistentStoreConfig represents configuration for RateLimiterMemoryStore
Click to show internal directories.
Click to hide internal directories.