Documentation
¶
Overview ¶
Package defhandler provide default handler construction
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StatusBadRequest is http.HandlerFunc that always send HTTP status BadRequest StatusBadRequest = ResponseCode(http.StatusBadRequest) StatusUnauthorized = ResponseCode(http.StatusUnauthorized) // StatusForbidden is http.HandlerFunc that always send HTTP status Forbidden StatusForbidden = ResponseCode(http.StatusForbidden) // StatusNotFound is http.HandlerFunc that always send HTTP status NotFound StatusNotFound = ResponseCode(http.StatusNotFound) // StatusMethodNotAllowed is http.HandlerFunc that always send HTTP status MethodNotAllowed StatusMethodNotAllowed = ResponseCode(http.StatusMethodNotAllowed) // StatusUnsupportedMediaType is http.HandlerFunc that always send HTTP status UnsupportedMediaType StatusUnsupportedMediaType = ResponseCode(http.StatusUnsupportedMediaType) // StatusUnprocessableEntity is http.HandlerFunc that always send HTTP status UnprocessableEntity StatusUnprocessableEntity = ResponseCode(http.StatusUnprocessableEntity) // StatusNotImplemented is http.HandlerFunc that always send HTTP status NotImplemented StatusNotImplemented = ResponseCode(http.StatusNotImplemented) // StatusInternalServerError is http.HandlerFunc that always send HTTP status InternalServerError StatusInternalServerError = ResponseCode(http.StatusInternalServerError) )
Functions ¶
func Redirect ¶
func Redirect(url string) http.HandlerFunc
Redirect return http.HandlerFunc that always redirect to url
func ResponseCode ¶
func ResponseCode(code int) http.HandlerFunc
ResponseCode return http.HandlerFunc that always send empty HTTP response with defined status code
func ResponseCodeWithMessage ¶
func ResponseCodeWithMessage(code int, message string) http.HandlerFunc
ResponseCodeWithMessage return http.HandlerFunc that always send HTTP response with defined status code and text/plain message
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.