Refactored the scheduler and source interfaces to accommondate both polling (e.g., HTTP) sources and streaming (e.g., message queue) sources.

This commit is contained in:
2026-02-08 15:03:46 -06:00
parent 3c95fa97cd
commit fafba0f01b
4 changed files with 118 additions and 19 deletions

View File

@@ -83,9 +83,9 @@ func (c *Config) Validate() error {
m.Add(fieldErr(path+".driver", "is required (e.g. openmeteo_observation, rss_feed, ...)"))
}
// Every
if s.Every.Duration <= 0 {
m.Add(fieldErr(path+".every", "must be a positive duration (e.g. 15m, 1m, 30s)"))
// Every (optional but if present must be >=0)
if s.Every.Duration < 0 {
m.Add(fieldErr(path+".every", "is optional, but must be a positive duration (e.g. 15m, 1m, 30s) if provided"))
}
// Kind (optional but if present must be non-empty after trimming)