mirror of
https://codeberg.org/VnPower/PixivFE
synced 2024-12-06 19:16:23 +01:00
079993e801
Rename package handlers to middleware, since most are middleware router.go is not middleware. can be moved out to router/router.go
15 lines
789 B
Go
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
|