Documentation
¶
Index ¶
- Variables
- func CacheFileSystem(path string) (http.FileSystem, error)
- func ErrFuncDefault(w http.ResponseWriter, r *http.Request, err error)
- func GetSympleError(err error) (error, int)
- func NewRouter(handler ErrorHandlerFunc) *routerState
- type ContentType
- type Error
- type ErrorHandlerFunc
- type HandlerFunc
- type HttpError
- type Middleware
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadRequest = Error{"bad request", http.StatusBadRequest} ErrPaymentRequired = Error{"payment required", http.StatusPaymentRequired} ErrForbidden = Error{"forbidden", http.StatusForbidden} ErrNotFound = Error{"ressource not found", http.StatusNotFound} ErrMethodNotAllowed = Error{"method not allowed", http.StatusMethodNotAllowed} ErrNotAcceptable = Error{"not acceptable", http.StatusNotAcceptable} ErrProxyAuthRequired = Error{"proxy authentication required", http.StatusProxyAuthRequired} ErrRequestTimeout = Error{"request time-out", http.StatusRequestTimeout} ErrConflict = Error{"conflict", http.StatusConflict} ErrGone = Error{"gone", http.StatusGone} ErrLengthRequired = Error{"length required", http.StatusLengthRequired} ErrPreconditionFailed = Error{"precondition failed", http.StatusPreconditionFailed} ErrRequestEntityTooLarge = Error{"request entity too large", http.StatusRequestEntityTooLarge} ErrRequestURITooLong = Error{"request URI too long", http.StatusRequestURITooLong} ErrUnsupportedMediaType = Error{"unsupported media type", http.StatusUnsupportedMediaType} ErrRequestedRangeNotSatisfiable = Error{"requested range unsatisfiable", http.StatusRequestedRangeNotSatisfiable} ErrExpectationFailed = Error{"expectation failed", http.StatusExpectationFailed} ErrTeapot = Error{"i'm a teapot", http.StatusTeapot} ErrMisdirectedRequest = Error{"misdirected request", http.StatusMisdirectedRequest} ErrUnprocessableEntity = Error{"unprocessable entiy", http.StatusUnprocessableEntity} ErrLocked = Error{"locked", http.StatusLocked} ErrFailedDependency = Error{"failed dependency", http.StatusFailedDependency} ErrTooEarly = Error{"too early", http.StatusTooEarly} ErrUpgradeRequired = Error{"upgrade required", http.StatusUpgradeRequired} ErrPreconditionRequired = Error{"precondition required", http.StatusPreconditionRequired} ErrTooManyRequests = Error{"too many requests", http.StatusTooManyRequests} ErrRequestHeaderFieldsTooLarge = Error{"request header fields too large", http.StatusRequestHeaderFieldsTooLarge} ErrInternalServer = Error{"internal server error", http.StatusInternalServerError} ErrNotImplemented = Error{"not implemented", http.StatusNotImplemented} ErrBadGateway = Error{"bad gateway", http.StatusBadGateway} ErrGatewayTimeout = Error{"gateway time-out", http.StatusGatewayTimeout} ErrHTTPVersionNotSupported = Error{"http version not supported", http.StatusHTTPVersionNotSupported} ErrVariantAlsoNegotiates = Error{"variant also negotiates", http.StatusVariantAlsoNegotiates} ErrInsufficientStorage = Error{"insufficient storage", http.StatusInsufficientStorage} ErrLoopDetected = Error{"loop detected", http.StatusLoopDetected} ErrNotExtended = Error{"not extended", http.StatusNotExtended} ErrNetworkAuthenticationRequired = Error{"network authentication required", http.StatusNetworkAuthenticationRequired} )
Functions ¶
func CacheFileSystem ¶
func CacheFileSystem(path string) (http.FileSystem, error)
func ErrFuncDefault ¶
func ErrFuncDefault(w http.ResponseWriter, r *http.Request, err error)
func GetSympleError ¶ added in v0.1.2
func NewRouter ¶
func NewRouter(handler ErrorHandlerFunc) *routerState
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeTextPlain ContentType = "text/plain" ContentTypeTextHtml ContentType = "text/html" ContentTypeJson ContentType = "application/json" ContentTypeXml ContentType = "application/xml" ContentTypeFormEncoded ContentType = "application/x-www-form-urlencoded" ContentTypeFormData ContentType = "multipart/form-data" )
type ErrorHandlerFunc ¶
type ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ErrorHandlerFunc is the function being called to handle HandlerFunc errors
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request) error
HandlerFunc is like http.HandlerFunc but returning an error
type Middleware ¶
type Middleware func(HandlerFunc) HandlerFunc
Click to show internal directories.
Click to hide internal directories.