Documentation
¶
Overview ¶
Package web is a platform module: server rendered pages next to the API — templ components, htmx fragments, CSRF protection, sealed cookies and hashed static assets from kit/webx. Pages are plain routes of the api module, so they share its server, its request ids, metrics and access log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// SecretKey seals cookies; at least 32 bytes. Changing it signs every visitor out of
// their unfinished forms, nothing more.
SecretKey []byte
// InsecureCookies allows cookies over plain http: local development only.
InsecureCookies bool
}
Config holds module settings.
type Kit ¶
type Kit struct {
CSRF *webx.CSRF
Cookies *webx.Cookies
// Secure tells whether cookies are marked Secure.
Secure bool
}
Kit is what pages use: the CSRF protection and the sealed cookies.
Click to show internal directories.
Click to hide internal directories.