we now got websockets baby

This commit is contained in:
2026-01-26 00:29:57 +11:00
parent ce524702f0
commit a3dafa592b
23 changed files with 621 additions and 312 deletions

View File

@@ -8,12 +8,17 @@ func (c Key) String() string {
return "oslstats context key " + string(c)
}
var HTMXLogKey Key = Key("htmxlog")
var DevModeKey Key = Key("devmode")
func HTMXLog(ctx context.Context) bool {
htmxlog, ok := ctx.Value(HTMXLogKey).(bool)
func DevMode(ctx context.Context) DevInfo {
devmode, ok := ctx.Value(DevModeKey).(DevInfo)
if !ok {
return false
return DevInfo{}
}
return htmxlog
return devmode
}
type DevInfo struct {
WebsocketBase string
HTMXLog bool
}