Codevault initial commit

This commit is contained in:
2026-08-16 16:23:14 +03:00
commit 6ee80f1c8f
47 changed files with 3177 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package config
import (
"fmt"
"time"
)
type RateLimitConfig struct {
MaxFailures int `yaml:"max_failures"`
Window time.Duration `yaml:"window"`
}
func (rc *RateLimitConfig) Validate() error {
if rc.MaxFailures <= 0 {
return fmt.Errorf("max_failures must be positive")
}
if rc.Window <= 0 {
return fmt.Errorf("window must be positive")
}
return nil
}