Files
oslstats/pkg/contexts/keys.go
2026-01-26 00:31:01 +11:00

25 lines
377 B
Go

package contexts
import "context"
type Key string
func (c Key) String() string {
return "oslstats context key " + string(c)
}
var DevModeKey Key = Key("devmode")
func DevMode(ctx context.Context) DevInfo {
devmode, ok := ctx.Value(DevModeKey).(DevInfo)
if !ok {
return DevInfo{}
}
return devmode
}
type DevInfo struct {
WebsocketBase string
HTMXLog bool
}