Documentation
¶
Index ¶
- Constants
- func CORS(options CORSOptions) func(http.Handler) http.Handler
- func ContentLengthMiddleware(next http.Handler) http.Handler
- func GetRequestID(ctx context.Context) string
- func Logger(options ...LoggerOptions) func(http.Handler) http.Handler
- func RealIP(next http.Handler) http.Handler
- func RealIPWithOptions(options RealIPOptions) func(http.Handler) http.Handler
- func Recover(next http.Handler) http.Handler
- func RequestID(next http.Handler) http.Handler
- func SecurityHeaders(options ...SecurityHeadersOptions) func(http.Handler) http.Handler
- func Timeout(timeout time.Duration) func(http.Handler) http.Handler
- func Timer(next http.Handler) http.Handler
- type CORSOptions
- type LoggerOptions
- type RealIPOptions
- type SecurityHeadersOptions
Constants ¶
View Source
const RequestIDHeader = "X-Request-ID"
Variables ¶
This section is empty.
Functions ¶
func CORS ¶ added in v0.2.0
func CORS(options CORSOptions) func(http.Handler) http.Handler
CORS returns a Middleware that handles Cross-Origin Resource Sharing.
func ContentLengthMiddleware ¶ added in v0.2.0
ContentLengthMiddleware automatically sets the Content-Length header
func GetRequestID ¶ added in v0.9.0
func RealIPWithOptions ¶ added in v0.9.0
func RealIPWithOptions(options RealIPOptions) func(http.Handler) http.Handler
func SecurityHeaders ¶ added in v0.9.0
func SecurityHeaders(options ...SecurityHeadersOptions) func(http.Handler) http.Handler
Types ¶
type CORSOptions ¶ added in v0.2.0
type LoggerOptions ¶ added in v0.9.0
type RealIPOptions ¶ added in v0.9.0
type RealIPOptions struct {
TrustedProxies []string
}
Click to show internal directories.
Click to hide internal directories.