Files
PixivFE/server/middleware/doc.go
T
iacore 079993e801 Use proper rate limiter
Rename package handlers to middleware, since most are middleware

router.go is not middleware. can be moved out to router/router.go
2024-09-25 05:05:04 +00:00

15 lines
789 B
Go

/*
Package middleware provides HTTP request handling functionality for PixivFE.
It defines various middleware functions, request handlers, and routing logic to manage
incoming HTTP requests and produce appropriate responses.
The package includes middleware for security headers (SetPrivacyHeaders), error catching
and handling (CatchError, HandleError), rate limiting (IPRateLimiter, RateLimitRequest), logging (LogRequest),
panic recovery (RecoverFromPanic), and user context injection (ProvideUserContext). These
middlewares can be applied to routes to add cross-cutting functionality across multiple endpoints.
Route definitions are centralized in the DefineRoutes function, which sets up all paths
and their corresponding handlers using the gorilla/mux router.
*/
package middleware