8ed800271d
test: 迁移基准测试循环到 Go 1.24 b.Loop() API
...
- 所有 *_bench_test.go 文件从 for i := 0; i < b.N; i++ 改为 for b.Loop()
- 部分测试文件从 for i := 0; i < N; ... 改为 for range N 或 for i := range N
- 涵盖模块: cache, handler, http2, http3, loadbalance, logging, lua,
middleware/accesslog, middleware/bodylimit, middleware/rewrite,
middleware/security, netutil, resolver, server, ssl, stream
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 13:50:15 +08:00
76c9e9df54
test(http2): 添加 HTTP/2 服务器性能基准测试
...
覆盖 HTTP/2 帧编码、HPACK 头部压缩、流管理开销和完整请求往返延迟。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 11:44:45 +08:00
322573b9aa
test(http2,http3,proxy): 改进测试覆盖边界情况
...
- http2/adapter_test.go: 替换 pool reuse 测试,新增 header 转换边界测试
- 空头测试、特殊字符、多值头、长头名称
- http3/server_test.go: 替换 stats struct 测试,新增 Alt-Svc 头边界测试
- 端口边界值、禁用服务器、nil 配置
- http3/mock_test.go: 添加 QUIC listener mock 用于测试
- proxy/proxy_test.go: 添加 UpstreamTiming 边界测试
- 零值测试、部分标记测试
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 17:38:59 +08:00
d21e27fbac
fix(lint): 修复 golangci-lint 错误 (119 -> 0 issues)
...
主要修复:
- errcheck: defer Close 使用 //nolint:errcheck,类型断言改为 ok 检查
- govet fieldalignment: 调整结构体字段顺序优化内存布局
- revive unused-parameter: 将未使用参数改为 _
- exhaustive: 添加缺失的 switch case 或 default
- goconst: 提取重复字符串为常量 (accessAllow, accessDeny 等)
- staticcheck SA9003: 修复空分支逻辑
- gofmt: 运行 gofmt -w 格式化
- nolintlint: 修复 nolint 注释格式
其他改进:
- 更新 .golangci.yml 配置,启用更严格的检查
- 移除未使用的代码和导入
- 简化测试辅助函数调用
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 16:15:31 +08:00
6a08a6ab4a
fix(lint): 修复结构体字段对齐问题
...
调整 Config、Server、APIMethod 结构体字段顺序以优化内存布局,
解决 govet fieldalignment 检查警告。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 11:43:57 +08:00
50a960c539
feat(http2): 实现服务器优雅关闭功能
...
添加 GracefulShutdownTimeout 配置项,实现连接池管理和优雅关闭逻辑:
- HTTP2Config 新增 graceful_shutdown_timeout 字段(默认30秒)
- Server 添加连接池和等待组跟踪活跃连接
- Stop() 方法等待所有连接完成或超时后再退出
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 11:38:01 +08:00
bb77fa6a98
fix(lint): 修复 handler 和 http2 模块 lint 错误
...
- 添加 nolint:errcheck 注释到 defer Close 调用
- 修复 websocket.go 中重复的 nolint 注释格式
- 添加 staticcheck SA1019 nolint 注释到 deprecated WriteScheduler
- 移除 sendfile_linux.go 中未使用的 platformLinux 常量
- 添加文件末尾换行符
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 09:51:30 +08:00
8b382606df
Merge branch 'lint-fix' - resolve sendfile.go conflict
...
Conflict: sendfile.go (!linux build tag) was incorrectly modified to
include linuxSendfile and getSocketFd functions which already exist
in sendfile_linux.go.
Resolution: Keep HEAD version (simple fallback returning ENOTSUP) as
Linux implementation is properly separated in sendfile_linux.go.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 09:26:48 +08:00
239635301c
refactor(http2): 适配变量系统和 resolver 重命名
...
适配 variable.NewContext/ReleaseContext
适配 resolver.DNSCacheEntry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 09:40:57 +08:00
909bccc1eb
refactor(http2): 使用 textproto.CanonicalMIMEHeaderKey 替代手动实现
...
使用标准库 net/textproto 提供的规范化函数,确保 HTTP 头键
按照 RFC 7230 规范正确处理,包括 MIME 头的特殊大小写规则。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:35:29 +08:00
392d0b3449
docs: 新增模块 AGENTS.md 文档,更新目录索引
...
- 新增 http2、integration、resolver、variable 模块 AGENTS.md
- 更新 internal/AGENTS.md 目录表,补充新模块条目
- 更新 docs/prompts.md 添加 generate-config 缺失项分析提示
- 同步更新日期戳至 2026-04-09
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:35:29 +08:00
412bfebdd8
feat(http2): 新增 HTTP/2 支持,集成到服务器和应用
2026-04-09 12:18:52 +08:00