Documentation ¶
Overview ¶
Package middleware contains useful middleware handlers
Index ¶
- func AllowAnyOrigin() gin.HandlerFunc
- func AllowUSPYOrigin() gin.HandlerFunc
- func Bind(name string, data interface{}, bindingType binding.Binding) gin.HandlerFunc
- func DefineDomain() gin.HandlerFunc
- func DumpErrors() gin.HandlerFunc
- func JWT() gin.HandlerFunc
- func Logger() gin.HandlerFunc
- func RateLimiter(format string) gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowAnyOrigin ¶
func AllowAnyOrigin() gin.HandlerFunc
AllowAnyOrigin enables CORS for all origins testing purposes
func AllowUSPYOrigin ¶
func AllowUSPYOrigin() gin.HandlerFunc
AllowUSPYOrigin enables CORS for the Frontend, according to dev/prod environment variables
func Bind ¶
func Bind(name string, data interface{}, bindingType binding.Binding) gin.HandlerFunc
Bind takes a binder and returns a middleware function
func DefineDomain ¶
func DefineDomain() gin.HandlerFunc
DefineDomain is a middleware for setting the cookie domain values
func DumpErrors ¶
func DumpErrors() gin.HandlerFunc
DumpErrors is a middleware for dumping all errors that are set in the context
func JWT ¶
func JWT() gin.HandlerFunc
JWT is used to ensure authorization with the JWT Access Cookie.
func Logger ¶
func Logger() gin.HandlerFunc
Logger is the middleware used for logging to stdout
It is very similar to the default gin logging middleware, but omits errors at the last line This logger is useful to use with a custom error dumping middleware
func RateLimiter ¶
func RateLimiter(format string) gin.HandlerFunc
RateLimiter returns a middleware that sets up the rate limiting tool
Types ¶
This section is empty.