Documentation ¶
Index ¶
- Variables
- func ClientHost() func(next http.Handler) http.Handler
- func Context(contextKeys map[string]log.ContextField) func(next http.Handler) http.Handler
- func Correlation() func(next http.Handler) http.Handler
- func Cors(opts ...CorsOpts) cors.Options
- func CustomLog(opts ...LogOpts) func(next http.Handler) http.Handler
- func CustomWriter() func(next http.Handler) http.Handler
- func HTTPPath() func(next http.Handler) http.Handler
- func LogResponse() func(next http.Handler) http.Handler
- func MultilinePrettyPrintStack(ctx context.Context, rvr interface{})
- func PrintPrettyStack(ctx context.Context, rvr interface{})
- func Prometheus(next http.Handler) http.Handler
- func Recoverer(next http.Handler) http.Handler
- func SetPrintPrettyStack(fn PrintPrettyStackFn)
- func SetRecoverParser(p RecoverParserIface)
- func SetRecovererErrorWriter(w io.Writer)
- func Tracing() func(next http.Handler) http.Handler
- func XSSBodyValidation() func(next http.Handler) http.Handler
- type CorsOpts
- type LogOpts
- type PrintPrettyStackFn
- type RecoverParserIface
- type RecovererLogStack
Constants ¶
This section is empty.
Variables ¶
View Source
var IsTTY bool
Functions ¶
func CustomWriter ¶ added in v0.6.0
CustomWriter wraps the http.ResponseWriter into a new hyper.Writer
func LogResponse ¶ added in v0.6.0
LogResponse middleware is responsible for log the response body
func MultilinePrettyPrintStack ¶ added in v0.7.3
func PrintPrettyStack ¶ added in v0.5.1
func Recoverer ¶ added in v0.5.1
Recoverer is a middleware that recovers from panics, logs the panic (and a backtrace), and returns a HTTP 500 (Internal Server Error) status if possible. Recoverer prints a request ID if one is provided.
Alternatively, look at https://github.com/go-chi/httplog middleware pkgs.
func SetPrintPrettyStack ¶ added in v0.7.3
func SetPrintPrettyStack(fn PrintPrettyStackFn)
nolint:forbidigo
func SetRecoverParser ¶ added in v0.5.1
func SetRecoverParser(p RecoverParserIface)
func SetRecovererErrorWriter ¶ added in v0.5.3
Types ¶
type PrintPrettyStackFn ¶ added in v0.7.3
type RecoverParserIface ¶ added in v0.5.1
type RecoverParserIface interface {
Parse(ctx context.Context, debugStack []byte, rvr interface{}) ([]byte, error)
}
var RecoverParser RecoverParserIface = prettyStack{}
Click to show internal directories.
Click to hide internal directories.