Versions in this module Expand all Collapse all v5 v5.0.10 Jul 24, 2023 Changes in this version + const RequestIDKey + var DefaultLogger func(next http.Handler) http.Handler + var IsTTY bool + var LogEntryCtxKey = &contextKey + var RequestIDHeader = "X-Request-Id" + var URLFormatCtxKey = &contextKey + func AllowContentEncoding(contentEncoding ...string) func(next http.Handler) http.Handler + func AllowContentType(contentTypes ...string) func(next http.Handler) http.Handler + func BasicAuth(realm string, creds map[string]string) func(next http.Handler) http.Handler + func CleanPath(next http.Handler) http.Handler + func Compress(level int, types ...string) func(next http.Handler) http.Handler + func ContentCharset(charsets ...string) func(next http.Handler) http.Handler + func GetHead(next http.Handler) http.Handler + func GetReqID(ctx context.Context) string + func Heartbeat(endpoint string) func(http.Handler) http.Handler + func Logger(next http.Handler) http.Handler + func Maybe(mw func(http.Handler) http.Handler, maybeFn func(r *http.Request) bool) func(http.Handler) http.Handler + func New(h http.Handler) func(next http.Handler) http.Handler + func NextRequestID() uint64 + func NoCache(h http.Handler) http.Handler + func PageRoute(path string, handler http.Handler) func(http.Handler) http.Handler + func PathRewrite(old, new string) func(http.Handler) http.Handler + func PrintPrettyStack(rvr interface{}) + func Profiler() http.Handler + func RealIP(h http.Handler) http.Handler + func Recoverer(next http.Handler) http.Handler + func RedirectSlashes(next http.Handler) http.Handler + func RequestID(next http.Handler) http.Handler + func RequestLogger(f LogFormatter) func(next http.Handler) http.Handler + func RequestSize(bytes int64) func(http.Handler) http.Handler + func SetHeader(key, value string) func(next http.Handler) http.Handler + func StripSlashes(next http.Handler) http.Handler + func Throttle(limit int) func(http.Handler) http.Handler + func ThrottleBacklog(limit, backlogLimit int, backlogTimeout time.Duration) func(http.Handler) http.Handler + func ThrottleWithOpts(opts ThrottleOpts) func(http.Handler) http.Handler + func Timeout(timeout time.Duration) func(next http.Handler) http.Handler + func URLFormat(next http.Handler) http.Handler + func WithLogEntry(r *http.Request, entry LogEntry) *http.Request + func WithValue(key, val interface{}) func(next http.Handler) http.Handler + type Compressor struct + func NewCompressor(level int, types ...string) *Compressor + func (c *Compressor) Handler(next http.Handler) http.Handler + func (c *Compressor) SetEncoder(encoding string, fn EncoderFunc) + type DefaultLogFormatter struct + Logger LoggerInterface + NoColor bool + func (l *DefaultLogFormatter) NewLogEntry(r *http.Request) LogEntry + type EncoderFunc func(w io.Writer, level int) io.Writer + type HeaderRoute struct + MatchAny []Pattern + MatchOne Pattern + Middleware func(next http.Handler) http.Handler + func (r HeaderRoute) IsMatch(value string) bool + type HeaderRouter map[string][]HeaderRoute + func RouteHeaders() HeaderRouter + func (hr HeaderRouter) Handler(next http.Handler) http.Handler + func (hr HeaderRouter) Route(header, match string, middlewareHandler func(next http.Handler) http.Handler) HeaderRouter + func (hr HeaderRouter) RouteAny(header string, match []string, ...) HeaderRouter + func (hr HeaderRouter) RouteDefault(handler func(next http.Handler) http.Handler) HeaderRouter + type LogEntry interface + Panic func(v interface{}, stack []byte) + Write func(status, bytes int, header http.Header, elapsed time.Duration, ...) + func GetLogEntry(r *http.Request) LogEntry + type LogFormatter interface + NewLogEntry func(r *http.Request) LogEntry + type LoggerInterface interface + Print func(v ...interface{}) + type Pattern struct + func NewPattern(value string) Pattern + func (p Pattern) Match(v string) bool + type ThrottleOpts struct + BacklogLimit int + BacklogTimeout time.Duration + Limit int + RetryAfterFn func(ctxDone bool) time.Duration + type WrapResponseWriter interface + BytesWritten func() int + Status func() int + Tee func(io.Writer) + Unwrap func() http.ResponseWriter + func NewWrapResponseWriter(w http.ResponseWriter, protoMajor int) WrapResponseWriter