Documentation
¶
Overview ¶
Package failer implements HTTP handlers that serve error pages. There is one common implementation of that HTTP handler, which is instantiated for each possibly served error page.
Index ¶
- Variables
- func ServeBadRequest(writer http.ResponseWriter, request *http.Request)
- func ServeConflict(writer http.ResponseWriter, request *http.Request)
- func ServeInternalServerError(writer http.ResponseWriter, request *http.Request)
- func ServeMethodNotAllowed(writer http.ResponseWriter, request *http.Request)
- func ServeNotFound(writer http.ResponseWriter, request *http.Request)
- func ServeUnauthorized(writer http.ResponseWriter, request *http.Request)
- func ServeUnsupportedMediaType(writer http.ResponseWriter, request *http.Request)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BadRequestHandler = newFailer("Oops, bad request", http.StatusBadRequest) NotFoundHandler = newFailer("Sorry, not found", http.StatusNotFound) MethodNotAllowedHandler = newFailer("Oops, method not allowed", http.StatusMethodNotAllowed) ConflictHandler = newFailer("Sorry, there's a conflict", http.StatusConflict) UnsupportedMediaTypeHandler = newFailer("Sorry, unsupported media type", http.StatusUnsupportedMediaType) )
View Source
var ( InternalServerErrorHandler = newFailer( "Oops, internal server error", http.StatusInternalServerError, ) )
Functions ¶
func ServeBadRequest ¶
func ServeBadRequest(writer http.ResponseWriter, request *http.Request)
func ServeConflict ¶
func ServeConflict(writer http.ResponseWriter, request *http.Request)
func ServeInternalServerError ¶
func ServeInternalServerError(writer http.ResponseWriter, request *http.Request)
func ServeMethodNotAllowed ¶
func ServeMethodNotAllowed(writer http.ResponseWriter, request *http.Request)
func ServeNotFound ¶
func ServeNotFound(writer http.ResponseWriter, request *http.Request)
func ServeUnauthorized ¶
func ServeUnauthorized(writer http.ResponseWriter, request *http.Request)
func ServeUnsupportedMediaType ¶
func ServeUnsupportedMediaType(writer http.ResponseWriter, request *http.Request)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.