failer

package
v0.0.0-...-3a5708c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
var (
	BadRequestHandler           = newFailer("Oops, bad request", http.StatusBadRequest)
	UnauthorizedHandler         = newFailer("Oops, unauthorized", http.StatusUnauthorized)
	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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL