RateLimiterMemoryStore is the built-in store implementation for RateLimiter
| 168 | |
| 169 | // RateLimiterMemoryStore is the built-in store implementation for RateLimiter |
| 170 | type RateLimiterMemoryStore struct { |
| 171 | visitors map[string]*Visitor |
| 172 | mutex sync.Mutex |
| 173 | rate float64 // for more info check out Limiter docs - https://pkg.go.dev/golang.org/x/time/rate#Limit |
| 174 | burst int |
| 175 | expiresIn time.Duration |
| 176 | lastCleanup time.Time |
| 177 | |
| 178 | timeNow func() time.Time |
| 179 | } |
| 180 | |
| 181 | // Visitor signifies a unique user's limiter details |
| 182 | type Visitor struct { |
nothing calls this directly
no outgoing calls
no test coverage detected