modulepackage
0.0.0-20241018144049-48b771552214
Repository: https://github.com/wansing/seal.git
Documentation: pkg.go.dev
# README
seal
Some kind of experimental headless filesystem-based content management system.
- Directory: is matched to request uri
- File without extension: registers a handler (maximum one per directory)
- handler is always run
- boolean return value tells whether to continue execution
- default handler executes template if the remaining path is empty
- File with extension: is converted to html, then parsed as a template
# Functions
GitReloadHandler returns a rate-limited handler which runs "git fetch" and "git reset --hard" in osDir, then calls reload.
Limit returns a function which calls fn up to n times per interval.
RedirectHandler returns a Handler which does a HTTP 303 redirect if the (remaining) request path is empty.
ReloadHandler returns a rate-limited handler which calls reload.
Slugify returns a modified version of the given string with [a-zA-Z0-9] retained and a dash in each gap.
TemplateHandler returns a Handler which, if reqpath is empty, executes dir.Template with TemplateData.
# Structs
A Dir represents a filesystem directory.
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
A ContentFunc processes file content, e.
A Handler responds to an HTTP request.
No description provided by the author