feat: initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package ratelimiter
|
||||
|
||||
import "time"
|
||||
|
||||
//! Use Redis for rate limiting when in multiple instances
|
||||
|
||||
type Limiter interface {
|
||||
Allow(ip string) (bool, time.Duration)
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
RequestsPerTimeFrame int
|
||||
TimeFrame time.Duration
|
||||
Enabled bool
|
||||
}
|
||||
Reference in New Issue
Block a user