Documentation ¶
Index ¶
- Variables
- func DefaultMaintenanceHandler() http.HandlerFunc
- func GetTemplate(ctx context.Context, name string) (*template.Template, error)
- func NewTemplateWriterService() *templateWriterService
- func StaticHandler(dir fs.FS) http.HandlerFunc
- func StaticMaintenanceHandler(PageTitle string, Template string) http.HandlerFunc
- type Template
- type TemplateContextKey
- type Templates
- type UserContextKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTemplateNotFound = errors.New("template not found")
ErrTemplateNotFound provides a static error that can be wrapped when template discovery fails.
Functions ¶
func DefaultMaintenanceHandler ¶
func DefaultMaintenanceHandler() http.HandlerFunc
func NewTemplateWriterService ¶
func NewTemplateWriterService() *templateWriterService
func StaticHandler ¶
func StaticHandler(dir fs.FS) http.HandlerFunc
StaticHandler wraps a http.FileServer with some extra handling that allows us to trap errors of various types (mainly 404 not found) and allow us to return nicer error pages.
func StaticMaintenanceHandler ¶
func StaticMaintenanceHandler(PageTitle string, Template string) http.HandlerFunc
Types ¶
type TemplateContextKey ¶
type TemplateContextKey struct{}
type UserContextKey ¶
type UserContextKey struct{}
Click to show internal directories.
Click to hide internal directories.