package
0.0.0-20220222184645-f755f484ff34
Repository: https://github.com/istreamlabs/huma.git
Documentation: pkg.go.dev
# Functions
AddLoggerOptions adds command line options for enabling debug logging.
ContentEncoding uses content negotiation with the client to pick an appropriate encoding (compression) method and transparently encodes the response.
DefaultChain sets up the default middlewares conveniently chained together into a single easy-to-add handler.
Defaults sets up the default middleware.
GetBufferedBody returns the buffered body from a request when using the recovery middleware, up to MaxLogBodyBytes.
GetLogger returns the contextual logger for the current request.
Logger creates a new middleware to set a tagged `*zap.SugarLogger` in the request context.
NewDefaultLogger returns a new low-level `*zap.Logger` instance.
OpenTracing provides a middleware for cross-service tracing support.
PreferMinimal will remove the response body and return 204 No Content for any 2xx response where the request had the Prefer: return=minimal set on the request.
Recovery prints stack traces on panic when used with the logging middleware.
SetLogger sets the contextual logger for the current request.
SetLoggerInContext allows you to override the logger in the current request context.
# Variables
LogLevel sets the current Zap root logger's level when using the logging middleware.
LogTracePrefix is used to prefix OpenTracing trace and span ID key names in emitted log message tag names.
MaxLogBodyBytes logs at most this many bytes of any request body during a panic when using the recovery middleware.
NewLogger is a function that returns a new logger instance to use with the logger middleware.
# Interfaces
Flagger lets you create command line flags and functions that use them.
Middlewarer lets you add middlewares.
# Type aliases
PanicFunc defines a function to run after a panic, which allows you to set up custom logging, metrics, etc.