feat: add http rate limiting

This commit is contained in:
2026-01-17 09:47:49 +08:00
parent 4f2b8ea3ad
commit c399a65d83
4 changed files with 68 additions and 16 deletions

View File

@@ -15,6 +15,7 @@ type Config struct {
BaseURI *string
Tls *Tls
Cors *Cors
RateLimit *RateLimit
}
type Tls struct {
@@ -27,6 +28,14 @@ type Cors struct {
Whitelist []Whitelist
}
type RateLimit struct {
Enabled bool
Max int
WindowSeconds int
Message string
SkipPaths []string
}
type Whitelist struct {
AllowOrigin string
AllowHeaders string