Documentation ¶
Index ¶
- Variables
- func ChainMiddlewares(handler http.Handler, middlewares ...Middleware) http.Handler
- func ConcatError(errs []error) error
- func IsNil(i any) bool
- func WrapError(err, wrapper error) error
- func WrapForbidden(err error) error
- func WrapInternal(err error) error
- func WrapInvalid(err error) error
- func WrapMethodNotAllowed(err error) error
- func WrapNotFound(err error) error
- func WrapUnauthorized(err error) error
- type Middleware
- type Pinger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalid occurs when checks fails. ErrInvalid = errors.New("invalid") ErrUnauthorized = errors.New("unauthorized") // ErrForbidden occurs when authorization header is missing. ErrForbidden = errors.New("forbidden") // ErrNotFound occurs when something is not found. ErrNotFound = errors.New("not found") // ErrMethodNotAllowed occurs when method is not allowed. ErrMethodNotAllowed = errors.New("method not allowed") // ErrInternalError occurs when shit happens. ErrInternalError = errors.New("internal error") )
Functions ¶
func ChainMiddlewares ¶
func ChainMiddlewares(handler http.Handler, middlewares ...Middleware) http.Handler
ChainMiddlewares chain middlewares call from last to first (so first item is the first called).
func ConcatError ¶
ConcatError concat errors to a single string.
func WrapForbidden ¶ added in v4.3.0
WrapForbidden wraps given error with forbidden error.
func WrapInternal ¶
WrapInternal wraps given error with internal error.
func WrapInvalid ¶
WrapInvalid wraps given error with invalid error.
func WrapMethodNotAllowed ¶
WrapMethodNotAllowed wraps given error with method not allowed error.
func WrapNotFound ¶
WrapNotFound wraps given error with not found error.
func WrapUnauthorized ¶ added in v4.3.0
WrapUnauthorized wraps given error with unauthorized error.
Types ¶
type Middleware ¶
Middleware describe a middleware in the net/http package form.
Click to show internal directories.
Click to hide internal directories.