Documentation
¶
Index ¶
- func CORS() gin.HandlerFunc
- func CORSWithConfig(appConfig *config.Config) gin.HandlerFunc
- func Logger() gin.HandlerFunc
- func MetricsMiddleware(ctx *core.APPContext) gin.HandlerFunc
- func NewAuthMiddleware(ctx *core.APPContext) gin.HandlerFunc
- func NewRateLimit(ctx *core.APPContext) gin.HandlerFunc
- type AuthMiddleware
- type RateLimit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSWithConfig ¶
func CORSWithConfig(appConfig *config.Config) gin.HandlerFunc
CORSWithConfig is a middleware that adds CORS headers to responses with configuration
func Logger ¶
func Logger() gin.HandlerFunc
Logger is a middleware that logs the request method, path, status code, and latency
func MetricsMiddleware ¶ added in v1.0.50
func MetricsMiddleware(ctx *core.APPContext) gin.HandlerFunc
MetricsMiddleware creates a middleware that collects HTTP request metrics. The service is resolved lazily on first request to avoid initialization order issues.
func NewAuthMiddleware ¶
func NewAuthMiddleware(ctx *core.APPContext) gin.HandlerFunc
NewAuthMiddleware creates a new auth middleware
func NewRateLimit ¶
func NewRateLimit(ctx *core.APPContext) gin.HandlerFunc
Types ¶
type AuthMiddleware ¶
type AuthMiddleware struct {
// contains filtered or unexported fields
}
AuthMiddleware is a middleware that checks if the user is authenticated
func (*AuthMiddleware) RequireAuth ¶
func (m *AuthMiddleware) RequireAuth(c *gin.Context)
RequireAuth is a middleware that checks if the user is authenticated
Click to show internal directories.
Click to hide internal directories.