middleware

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler added in v0.10.0

func ErrorHandler(validate IsError, handler shell.Handler) shell.Middleware

ErrorHandler returns middleware that will intercept all errors returned and execute a handler if the error matches a specified condition.

func ErrorHandlerCaughtError added in v0.10.0

func ErrorHandlerCaughtError(ctx context.Context) error

ErrorHandlerCaughtError returns the error caught by the ErrorHandler middleware to be referenced during the middleware handler.

func Recoverer

func Recoverer() shell.Middleware

Recoverer returns middleware which will allow the shell to recover from a panic The middleware will output the error and stack trace to the ResponseWriter error writer.

Types

type IsError added in v0.10.0

type IsError func(error) bool

IsError is used by the ErrorHandler middleware to determine if the received error should be used to execute the the ErrorHandlerFunction.

Jump to

Keyboard shortcuts

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