we now got websockets baby
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user