Documentation ¶
Overview ¶
Package middleware provides HTTP middlewares.
Index ¶
Constants ¶
View Source
const ThemeDefault = ThemeLight
ThemeDefault is the default color theme.
Variables ¶
This section is empty.
Functions ¶
func UserPreferences ¶ added in v0.3.0
UserPreferences sets the Accept-CH header and reads the user theme preference either from cookie (higher priority) or Sec-CH-Prefers-Color-Scheme (lower priority). The theme value is written to the request context and can be retrieved using GetCtxTheme.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
Types ¶
Click to show internal directories.
Click to hide internal directories.