middleware

package
v1.0.80 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS() gin.HandlerFunc

CORS is a middleware that adds CORS headers to responses

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

type RateLimit

type RateLimit struct {
	// contains filtered or unexported fields
}

func (*RateLimit) CheckRateLimit

func (r *RateLimit) CheckRateLimit(c *gin.Context)

func (*RateLimit) ShouldSkip

func (r *RateLimit) ShouldSkip(c *gin.Context) bool

Jump to

Keyboard shortcuts

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