File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,10 @@ func RateLimiterWithConfig(config RateLimiterConfig) echo.MiddlewareFunc {
153153type (
154154 // RateLimiterMemoryStore is the built-in store implementation for RateLimiter
155155 RateLimiterMemoryStore struct {
156- visitors map [string ]* Visitor
157- mutex sync.Mutex
158- rate rate.Limit
156+ visitors map [string ]* Visitor
157+ mutex sync.Mutex
158+ rate rate.Limit //for more info check out Limiter docs - https://pkg.go.dev/golang.org/x/time/rate#Limit.
159+
159160 burst int
160161 expiresIn time.Duration
161162 lastCleanup time.Time
@@ -223,7 +224,7 @@ func NewRateLimiterMemoryStoreWithConfig(config RateLimiterMemoryStoreConfig) (s
223224
224225// RateLimiterMemoryStoreConfig represents configuration for RateLimiterMemoryStore
225226type RateLimiterMemoryStoreConfig struct {
226- Rate rate.Limit // Rate of requests allowed to pass as req/s
227+ 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.
227228 Burst int // Burst additionally allows a number of requests to pass when rate limit is reached
228229 ExpiresIn time.Duration // ExpiresIn is the duration after that a rate limiter is cleaned up
229230}
You can’t perform that action at this time.
0 commit comments