kra-new/internal/server
Yvan 44ab14448a 优化结构 2026-08-22 17:43:14 +08:00
..
handler 优化结构 2026-08-22 14:12:00 +08:00
httpx 优化结构 2026-08-21 10:29:14 +08:00
middleware 优化结构 2026-08-22 17:43:14 +08:00
router 优化结构 2026-08-21 22:54:40 +08:00
README.md 优化结构 2026-08-22 17:43:14 +08:00
gin.go 优化结构 2026-08-22 14:12:00 +08:00
gin_test.go 优化结构 2026-08-22 17:43:14 +08:00
providers_system.go 优化结构 2026-08-22 11:26:58 +08:00
swagger.go 优化结构 2026-08-22 17:43:14 +08:00
swagger_test.go 优化结构 2026-08-22 17:43:14 +08:00
websocket_auth_test.go 优化结构 2026-08-22 12:13:16 +08:00

README.md

Server Layer

The root package owns Gin server lifecycle and Swagger setup. HTTP concerns are grouped by role:

  • handler/: resource handlers and HTTP boundary validation
  • middleware/: request metadata, auth, access control, audit, recovery, CORS
  • router/: resource route registration and the system route registrar
  • httpx/: system adapter for shared response and cookie helpers

Cross-cutting route policy lives in internal/routecatalog: public/private Swagger security, operation-audit flags, sensitive request-body handling and API group/description metadata must be declared there. Router contract tests keep the catalog aligned with the Gin registrations.

Keep new files in the matching role directory instead of adding transport files to the root package.