middleware

package
v0.0.0-...-6d5e59d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// XRequestIDKey defines X-Request-ID key string.
	XRequestIDKey = "X-Request-ID"
)

Variables

This section is empty.

Functions

func App

func App() gin.HandlerFunc

App set server server's information(server name and version)

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 Logger

func Logger(writer io.Writer) gin.HandlerFunc

Logger set log file and log format.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL