Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedType = errors.New("unsupported type")
Functions ¶
func ListenAndServe ¶
Serve requests using the given http.Server. If srv.Addr has the format `hostname:https`, then use autocert to manage certificates for the domain.
For http on port 80, you can use :http.
func ParseTemplateSet ¶
ParseTemplateSet parses sets of templates from an embed.FS.
Each directory constitutes a set of templates that are parsed together.
Structure (within a directory):
- share/* are always parsed.
- base.html will be parsed with each other file in same dir
Call a template with m[path].Execute(w, data) (root dir name is excluded).
For example, if you have
- /user/share/*
- /user/base.html
- /user/home.html
Then you call m["/user/home.html"].Execute(w, data).
func WithLogging ¶
func WithLogging(inner http.HandlerFunc) http.HandlerFunc
Types ¶
type FormScanner ¶ added in v0.2.0
type FormScanner struct {
// contains filtered or unexported fields
}
func NewFormScanner ¶ added in v0.2.0
func NewFormScanner(form url.Values) *FormScanner
func (*FormScanner) Error ¶ added in v0.2.0
func (s *FormScanner) Error() error
func (*FormScanner) Scan ¶ added in v0.2.0
func (s *FormScanner) Scan(name string, val any) *FormScanner
type PathScanner ¶ added in v0.5.0
type PathScanner struct {
// contains filtered or unexported fields
}
func NewPathScanner ¶ added in v0.5.0
func NewPathScanner(r *http.Request) *PathScanner
func (*PathScanner) Error ¶ added in v0.5.0
func (s *PathScanner) Error() error
func (*PathScanner) Scan ¶ added in v0.5.0
func (s *PathScanner) Scan(name string, val any) *PathScanner
Click to show internal directories.
Click to hide internal directories.