Add YAML config loading with validation, env overrides for secrets, and a web dashboard exposing health, stats, and recent events.
16 lines
350 B
V
16 lines
350 B
V
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
|
|
}
|