Documentation ¶
Index ¶
- Constants
- func App() gin.HandlerFunc
- func Cors() gin.HandlerFunc
- func JWTAuth() gin.HandlerFunc
- func Logger(writer io.Writer) gin.HandlerFunc
- func RateLimitMiddleware() gin.HandlerFunc
- func Recovery() gin.HandlerFunc
- func RequestID() gin.HandlerFunc
- func TokenAuth(ca cache.TokenCache) gin.HandlerFunc
Constants ¶
View Source
const (
// XRequestIDKey defines X-Request-ID key string.
XRequestIDKey = "X-Request-ID"
)
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
Cors use to resolve the former domain name Vinita input maxAge means how long (with second-precision) the results of a preflight request can be cached.
func JWTAuth ¶
func JWTAuth() gin.HandlerFunc
func RateLimitMiddleware ¶
func RateLimitMiddleware() gin.HandlerFunc
RateLimitMiddleware set a rate limit bucket.
limit the number of requests in order to avoid excessive requests causing server crashes.
func Recovery ¶
func Recovery() gin.HandlerFunc
func RequestID ¶
func RequestID() gin.HandlerFunc
RequestID set request id to gin.context. XRequestIDKey is show which header key will store the request ID.
func TokenAuth ¶
func TokenAuth(ca cache.TokenCache) gin.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.