Documentation
¶
Index ¶
- type UIVersion
- func (UIVersion) CaddyModule() caddy.ModuleInfo
- func (m *UIVersion) Cleanup() error
- func (m *UIVersion) Provision(ctx caddy.Context) error
- func (m UIVersion) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (m *UIVersion) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (m *UIVersion) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UIVersion ¶
type UIVersion struct {
// SQLite is the path / URI to the domains database. Prefer the CoreDNS
// style URI, e.g. file:/ui-versions.sqlite?immutable=1&mode=ro&nolock=1
SQLite string `json:"sqlite,omitempty"`
// Default is used when the host is missing from the database.
Default string `json:"default,omitempty"`
// contains filtered or unexported fields
}
UIVersion looks up the Host header in a SQLite database and sets {http.vars.ui_version} so later directives (e.g. root) can select a site tree.
Open the DB the same way as CoreDNS nameshift_context: a stable pool against an immutable read-only URI. Publishers replace the file atomically (mv); pool connections recycle every 5m so the new inode becomes visible. An in-memory host cache is cleared every 15m so stale mappings do not linger longer than that after an update.
func (UIVersion) CaddyModule ¶
func (UIVersion) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*UIVersion) UnmarshalCaddyfile ¶
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
ui_version {
sqlite file:/ui-versions.sqlite?immutable=1&mode=ro&nolock=1
default original
}
Click to show internal directories.
Click to hide internal directories.