Add config validation and dashboard
Add YAML config loading with validation, env overrides for secrets, and a web dashboard exposing health, stats, and recent events.
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
module main
|
||||
|
||||
import sources
|
||||
|
||||
// apply_defaults fills in default priority and tags when the event doesn't set them.
|
||||
pub fn apply_defaults(event sources.Event, defaults DefaultConfig) sources.Event {
|
||||
mut e := event.clone()
|
||||
if e.priority == 0 {
|
||||
e.priority = defaults.priority
|
||||
}
|
||||
if e.tags.len == 0 {
|
||||
e.tags = defaults.tags.clone()
|
||||
}
|
||||
return e
|
||||
}
|
||||
Reference in New Issue
Block a user