Documentation ¶
Index ¶
- Constants
- type CustomResponseWriter
- type Middleware
- func WithGzipHandler() Middleware
- func WithHeaders(headers http.Header) Middleware
- func WithPathStrip(logger logrus.FieldLogger, path string) Middleware
- func WithRateLimiter(logger logrus.FieldLogger, b TakeMaxDuration, maxDelay time.Duration) Middleware
- func WithRequestLogger(logger logrus.FieldLogger) Middleware
- type TakeMaxDuration
Constants ¶
View Source
const (
RequestID contextValue = "request_id"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomResponseWriter ¶
type CustomResponseWriter struct { http.ResponseWriter Status int BytesWritten int }
func NewCustomResponseWriter ¶
func NewCustomResponseWriter(w http.ResponseWriter) *CustomResponseWriter
func (*CustomResponseWriter) WriteHeader ¶
func (w *CustomResponseWriter) WriteHeader(statusCode int)
type Middleware ¶
func WithGzipHandler ¶
func WithGzipHandler() Middleware
func WithHeaders ¶
func WithHeaders(headers http.Header) Middleware
func WithPathStrip ¶
func WithPathStrip(logger logrus.FieldLogger, path string) Middleware
WithPathStrip strips the path from the request URL, paths always start with a /.
func WithRateLimiter ¶ added in v0.0.9
func WithRateLimiter(logger logrus.FieldLogger, b TakeMaxDuration, maxDelay time.Duration) Middleware
func WithRequestLogger ¶
func WithRequestLogger(logger logrus.FieldLogger) Middleware
Click to show internal directories.
Click to hide internal directories.