internal: add referrer classification

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibcaa09bfd4767876ea1cdd5b61c53b476a6a6964
This commit is contained in:
raf 2026-03-01 01:44:14 +03:00
commit be4534bac8
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
6 changed files with 355 additions and 0 deletions

View file

@ -44,6 +44,7 @@ type PathConfig struct {
type LimitsConfig struct {
MaxPaths int `yaml:"max_paths"`
MaxEventsPerMinute int `yaml:"max_events_per_minute"`
MaxSources int `yaml:"max_sources"`
}
// Server endpoints
@ -90,6 +91,11 @@ func (c *Config) Validate() error {
return fmt.Errorf("limits.max_paths must be greater than 0")
}
// Validate max_sources is positive
if c.Limits.MaxSources <= 0 {
return fmt.Errorf("limits.max_sources must be greater than 0")
}
// Set server defaults if not provided
if c.Server.ListenAddr == "" {
c.Server.ListenAddr = ":8080"