Add better configuration, through yaml file

This commit is contained in:
Pablu23
2024-11-06 10:21:30 +01:00
parent 91d128dbeb
commit a98b68177c
9 changed files with 188 additions and 59 deletions

View File

@@ -82,7 +82,7 @@ func (l *Limiter) Manage() {
}
func (l *Limiter) RateLimiter(next http.Handler) http.Handler {
log.Info().Msg("Enabling Ratelimits")
log.Info().Int("bucket_size", l.bucketSize).Int("bucket_refill", l.bucketRefill).Msg("Enabling Ratelimits")
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
addr := strings.Split(r.RemoteAddr, ":")[0]
l.rwLock.RLock()