Documentation ¶
Index ¶
- func AllowCORS(next http.Handler, opts *CORSOptions) http.Handler
- func DumpHttp(logLevel logger.Level) func(http.Handler) http.Handler
- func PanicCatcher(next http.Handler) http.Handler
- func Sequencer(baseHandler http.Handler, mws ...func(http.Handler) http.Handler) http.Handler
- func Timer(logLevel logger.Level) func(http.Handler) http.Handler
- type CORSOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowCORS ¶ added in v0.0.3
func AllowCORS(next http.Handler, opts *CORSOptions) http.Handler
AllowCORS sets headers for CORS mechanism supports secure.
func DumpHttp ¶ added in v0.0.3
DumpHttp dumps the HTTP request and response, and prints out with logFunc.
func PanicCatcher ¶
PanicCatcher handles panics in http.HandlerFunc.
Types ¶
type CORSOptions ¶ added in v0.0.3
type CORSOptions struct { AllowedOrigins []string // The origins that the server allows. AllowMethods []string // List of methods that the server allows. AllowHeaders []string // List of headers that the server allows. MaxAge int // Tells the browser how long (in seconds) to cache the response to the preflight request. AllowCredentials bool // Allow browsers to expose the response to the external JavaScript code. }
CORSOptions represents a functional option for configuring the CORS middleware.
Click to show internal directories.
Click to hide internal directories.