Documentation ¶
Index ¶
- func Cors(configuration CorsConfiguration) there.Middleware
- func Gzip(request there.Request, next there.Response) there.Response
- func Logger(configuration ...LoggerConfiguration) func(request there.Request, next there.Response) there.Response
- func Recoverer(request there.Request, next there.Response) there.Response
- func RequireHeader(key string, value string) func(request there.Request, next there.Response) there.Response
- func RequireHost(host string) func(request there.Request, next there.Response) there.Response
- func Sanitizer(request there.Request, next there.Response) there.Response
- func Skip(handler there.Middleware, exclude func(request there.Request) bool) there.Middleware
- type CorsConfiguration
- type LoggerConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors(configuration CorsConfiguration) there.Middleware
func Logger ¶ added in v2.2.1
func Logger(configuration ...LoggerConfiguration) func(request there.Request, next there.Response) there.Response
func RequireHeader ¶ added in v2.2.1
func RequireHeader(key string, value string) func(request there.Request, next there.Response) there.Response
RequireHeader is a middleware, that forces incoming requests to have a specific header. If this method is not used, only Status with status StatusBadRequest is returned.
func RequireHost ¶ added in v2.2.1
func RequireHost(host string) func(request there.Request, next there.Response) there.Response
RequireHost is a middleware, that forces incoming requests to have a specific host header set. If this header is not set, the String response with StatusBadRequest and the message "Invalid host for access to resource" is returned.
Types ¶
type CorsConfiguration ¶
type CorsConfiguration struct { AccessControlAllowOrigin string AccessControlAllowMethods string AccessControlAllowHeaders string }
func CorsAllowAllConfiguration ¶ added in v2.2.1
func CorsAllowAllConfiguration() CorsConfiguration
Source Files ¶
Click to show internal directories.
Click to hide internal directories.