Documentation ¶
Index ¶
- func ExecuteTemplate(name string, w http.ResponseWriter, data interface{})
- func FromForm(r *http.Request, s interface{}) error
- func LoadTemplates(files map[string][]byte)
- func SetHeader(parent http.Handler, kv ...string) http.Handler
- func SetHeaderMap(parent http.Handler, hdrs map[string]string) http.Handler
- func WithLogging(parent http.Handler) http.Handler
- func WriteJSON(w http.ResponseWriter, v interface{}) error
- type FS
- type ParseError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteTemplate ¶
func ExecuteTemplate(name string, w http.ResponseWriter, data interface{})
func FromForm ¶
FromForm fills struct `s` from the HTTP Form/Query values in `r`.
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, v interface{}) error
WriteJSON takes a struct in v, marshals it to JSON, and writes the output to w. It can be useful when writing HTTP handlers that output JSON. It calls http.Error to return a 500 error if the marshalling fails.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError represents errors when parsing the values.
Click to show internal directories.
Click to hide internal directories.