Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeHTML = "text/html" ContentTypeText = "text/plain" ContentTypeXML = "text/xml" ContentTypeCSS = "text/css" ContentTypeJS = "application/javascript" ContentTypeForm = "application/x-www-form-urlencoded" ContentTypeMultipart = "multipart/form-data" ContentTypeOctetStream = "application/octet-stream" )
Variables ¶
This section is empty.
Functions ¶
func Make ¶
func Make(h HTTPHandler) http.HandlerFunc
Types ¶
type HTTPErrorHandler ¶
type HTTPErrorHandler func(hc HandlerContext, err error)
type HTTPHandler ¶
type HTTPHandler func(hc HandlerContext) error
type HandlerContext ¶
type HandlerContext interface { Request() *http.Request SetRequest(*http.Request) Response() http.ResponseWriter SetResponse(http.ResponseWriter) Get(string) interface{} Set(string, interface{}) Delete(string) QueryParams() url.Values QueryParam(string) string QueryString() string JSON(code int, v interface{}) error Render(templ.Component) error Redirect(code int, url string) Getenv(key string, defaults ...string) string URLParam(string) string // contains filtered or unexported methods }
func NewHandlerContext ¶
func NewHandlerContext(w http.ResponseWriter, r *http.Request) HandlerContext
Click to show internal directories.
Click to hide internal directories.