Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandlerFunc ¶
func NewHandlerFunc(path string, opts *Options) (http.HandlerFunc, error)
NewHandlerFunc returns an http.HandlerFunc that does very simple pages serving from the specified path. The pageData function can be used to return template data.
Types ¶
type Options ¶
type Options struct { LogOutput io.Writer PageData func(page *Page) error FuncMap map[string]interface{} AllowGzip bool RedirectHost string // APIEndpoints are all the endpoints that are not backed by an html // template. APIEndpoints []string EmbeddedFS FS }
Options for the handler
type Page ¶
type Page struct { Input struct { Error error LocalPath string ContentType string Request *http.Request } Output struct { Cookies []*http.Cookie Data interface{} } }
A Page is passed to the pageData function
Click to show internal directories.
Click to hide internal directories.