internal: add referrer classification
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibcaa09bfd4767876ea1cdd5b61c53b476a6a6964
This commit is contained in:
parent
0691e5ee34
commit
be4534bac8
6 changed files with 355 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue