add request rate limiter
This commit is contained in:
10
limiter/rate/limiter.go
Normal file
10
limiter/rate/limiter.go
Normal file
@ -0,0 +1,10 @@
|
||||
package rate
|
||||
|
||||
type Limiter interface {
|
||||
Allow(n int) bool
|
||||
Limit() float64
|
||||
}
|
||||
|
||||
type RateLimiter interface {
|
||||
Limiter(key string) Limiter
|
||||
}
|
Reference in New Issue
Block a user