lolly/docs/lua/middleware/AGENTS.md
xfy 4562dd5a7d docs: 添加子目录 AGENTS.md 文档
deepinit 生成的子目录级 AGENTS.md 文件,帮助 AI agents 理解各功能模块:
- docs/config/: advanced, basic, caching, load-balancing, lua, rewriting, security, ssl
- docs/lua/: api-gateway, authentication, caching, dynamic-routing, logging-monitoring, middleware, rate-limiting, websocket

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-23 10:35:49 +08:00

39 lines
918 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2026-04-23 | Updated: 2026-04-23 -->
# middleware
## Purpose
中间件示例目录,演示 Lua 中间件的概念和用法。
## Key Files
| File | Description |
|------|-------------|
| `README.md` | 中间件概念说明和使用指南 |
## For AI Agents
### Working In This Directory
- 中间件按处理阶段执行rewrite → access → content → log
- 中间件可链式组合
- 支持请求修改和响应拦截
- 参考 OpenResty 风格的中间件模式
### Testing Requirements
- 中间件逻辑通过集成测试验证
- 测试中间件链执行顺序
### Common Patterns
- 链式调用:按注册顺序执行
- 请求修改:`ngx.req.set_header()`
- 响应拦截:`ngx.exit()` 提前返回
## Dependencies
### Internal
- `../../../internal/lua/` - Lua 脚本引擎
- `../../../internal/middleware/` - 中间件框架实现
<!-- MANUAL: -->