feat: add Redis based rate limiting for multiple instances

This commit is contained in:
Jonas Kaninda
2024-11-14 11:38:36 +01:00
parent 3c4920ec9a
commit a874d14194
8 changed files with 112 additions and 27 deletions

View File

@@ -178,6 +178,8 @@ type Gateway struct {
SSLCertFile string `yaml:"sslCertFile" env:"GOMA_SSL_CERT_FILE, overwrite"`
// SSLKeyFile SSL Private key file
SSLKeyFile string `yaml:"sslKeyFile" env:"GOMA_SSL_KEY_FILE, overwrite"`
// Redis contains redis database details
Redis Redis `yaml:"redis"`
// WriteTimeout defines proxy write timeout
WriteTimeout int `yaml:"writeTimeout" env:"GOMA_WRITE_TIMEOUT, overwrite"`
// ReadTimeout defines proxy read timeout
@@ -204,6 +206,7 @@ type Gateway struct {
InterceptErrors []int `yaml:"interceptErrors"`
// Cors holds proxy global cors
Cors Cors `yaml:"cors"`
// Routes holds proxy routes
Routes []Route `yaml:"routes"`
}
@@ -287,3 +290,8 @@ type Health struct {
Interval string
HealthyStatuses []int
}
type Redis struct {
// Addr redis hostname and post number :
Addr string `yaml:"addr"`
Password string `yaml:"password"`
}