xfy911
396a466de1
docs: add documentation comments for exported constants and variables
...
- Add comments for lua/api_log.go HTTP status codes and log levels
- Add comments for variable/builtin.go and ssl.go constants
- Add comments for utils/httperror.go error variables
- Add comments for matcher/matcher.go location types
- Add comments for compression/compression.go algorithms
- Include author attribution (xfy)
2026-06-03 15:28:53 +08:00
dc7358bf4e
feat(variable): 添加 EphemeralGet 和 PersistentGet 零拷贝变量访问 API
...
- 新增 EphemeralGet() 方法返回 []byte,用于请求范围内的零拷贝访问
- 新增 PersistentGet() 方法返回 string,用于跨请求持久存储
- BuiltinVariable 结构体添加 GetterBytes 字段支持字节获取器
- Context 结构体添加 bytesCache map 缓存字节值
- 为 $host、$request_uri、$uri、$args、$request_method 添加字节获取器
- 添加完整的单元测试和性能基准测试
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 13:50:15 +08:00
0731dc46e4
refactor(variable): 重命名核心类型移除冗余前缀
...
VariableContext → Context
VariableStore → Store
ReleaseVariableContext → ReleaseContext (别名保留向后兼容)
提取硬编码字符串为命名常量 sslProtocolNone
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 09:40:17 +08:00
61455412eb
feat(variable,proxy): 新增上游变量支持,集成到代理请求处理
...
- 新增 upstream_addr、upstream_status、upstream_response_time 等变量
- 新增 UpstreamTiming 结构体捕获连接、首字节、响应时间
- Proxy.ServeHTTP 集成变量上下文,记录上游时间
- 新增测试覆盖上游变量和计时功能
Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-08 14:36:37 +08:00
c95f474539
feat(variable): 新增变量系统支持
...
新增 internal/variable 包,提供 Nginx 风格的变量展开功能:
- 支持 $remote_addr、$host、$uri、$args 等 30+ 内置变量
- 使用 sync.Pool 优化 VariableContext 分配
- 支持 set_response_info 存储响应状态信息
添加 github.com/google/uuid 依赖用于请求 ID 生成。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 11:36:49 +08:00