package
0.0.0-20240906075750-48538dd4f522
Repository: https://github.com/lab42/httplib.git
Documentation: pkg.go.dev
# Functions
NewCSPMiddleware creates a new CSPMiddleware instance.
NewCSRFMiddleware creates a new CSRFMiddleware instance.
NewDatadogMiddleware creates a new DatadogMiddleware instance.
NewResponseWriter creates a new responseWriter instance.
NewGzipMiddleware creates a new GzipMiddleware instance with the specified compression level.
NewGzipResponseWriter creates a new GzipResponseWriter instance.
NewPrometheusMiddleware creates a new PrometheusMiddleware instance.
NewResponseWriter creates a new responseWriter instance.
NewRateLimiter creates a new RateLimiter with the specified requests per second limit.
NewRecoveryMiddleware creates a new RecoveryMiddleware instance.
NewTimeoutMiddleware creates a new TimeoutMiddleware instance.
NewZapMiddleware creates a new ZapMiddleware instance.
NewZeroLogMiddleware creates a new ZeroLogMiddleware instance.
# Structs
CSPMiddleware is a middleware that sets the Content Security Policy (CSP) header.
CSRFMiddleware is a middleware that provides Cross-Site Request Forgery (CSRF) protection.
DatadogMiddleware is a middleware that sends request metrics to Datadog.
GzipMiddleware is a middleware that compresses response data using gzip.
GzipResponseWriter is a custom response writer that wraps a gzip writer.
PrometheusMiddleware is a middleware that collects Prometheus metrics for HTTP requests.
RateLimiter is a middleware for rate limiting requests.
RecoveryMiddleware is a middleware that recovers from panics and logs errors.
TimeoutMiddleware is a middleware that sets a timeout for handling requests.
ZapMiddleware is a middleware that logs HTTP request information using Zap.
ZeroLogMiddleware is a middleware that logs HTTP request information using ZeroLog.