aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-01-28 03:12:23 -0800
committerFuwn <[email protected]>2026-01-28 03:12:23 -0800
commitdefea76033f75804a45bbb650e19cb16c677295b (patch)
treecfc507fb0d782f02925c001429df7d3c1d079420 /internal/config/config.go
parentfix: Handle libsql string-based time values (diff)
downloadkaze-defea76033f75804a45bbb650e19cb16c677295b.tar.xz
kaze-defea76033f75804a45bbb650e19cb16c677295b.zip
feat: Add SSE streaming for instant page load and real-time updates
New refresh_mode 'stream' eliminates blocking database queries from initial page load. Page renders instantly with skeleton UI, then hydrates via SSE. - Add SSE hub for managing client connections and broadcasting - Add /api/stream endpoint with init and update events - Add stream.html skeleton template with loading animations - Wire scheduler to broadcast on check completion - Backwards compatible: page/api modes unchanged
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 3ac03ea..5e74b5c 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -648,12 +648,10 @@ func (c *Config) validate() error {
return fmt.Errorf("api.access is 'authenticated' but no api.keys provided")
}
- // Validate refresh mode
switch c.Display.RefreshMode {
- case "page", "api":
- // Valid modes
+ case "page", "api", "stream":
default:
- return fmt.Errorf("invalid display.refresh_mode %q (must be page or api)", c.Display.RefreshMode)
+ return fmt.Errorf("invalid display.refresh_mode %q (must be page, api, or stream)", c.Display.RefreshMode)
}
if c.Display.RefreshInterval < 5 {