29752f62bd
fix: resolve golangci-lint issues across multiple packages
...
- stream: fix atomic.Int64 usage in tests and benchmarks
- server: fix errcheck, goconst ("tcp" -> constant), and govet shadow
- app: add missing ServerModeAuto case in requiresFullRestart
- lua: fix nolintlint unused directive warnings
- proxy: use `any` instead of `interface{}`
2026-06-03 18:17:07 +08:00
6f17bbad7e
chore: remove trailing blank lines and clean up whitespace
2026-06-03 18:08:34 +08:00
2734b04d8f
refactor: remove 16.8k lines of dead code across all internal packages
...
- Delete unused files: tempfile subsystem, matcher variants, server/internal
- Remove 200+ unused functions across proxy, ssl, lua, http2/3, stream, variable
- Fix proxy test type errors (backgroundRefresh ctx→Request)
- Move bench/tools mock backend into internal/testutil
- Remove corresponding test functions for all deleted code
2026-06-03 16:15:43 +08:00
f145a8770e
refactor: modernize code with Go 1.22+ features
...
Apply modern Go patterns across the codebase:
- Replace `interface{}` with `any` (Go 1.18+)
- Use `for range n` instead of `for i := 0; i < n; i++` (Go 1.22+)
- Replace `sort.Slice` with `slices.Sort` from slices package
- Simplify sync.WaitGroup patterns with errgroup where appropriate
- Add Makefile targets for modernize analyzer
Total: 84 files updated, net reduction of 79 lines
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 10:37:45 +08:00
4e535deb80
refactor(stream): 重命名 SSL 管理器类型移除冗余前缀
...
StreamSSLManager → SSLManager
StreamProxySSLManager → ProxySSLManager
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 09:40:26 +08:00
f2352ab9cc
docs(config,stream,logging,handler,proxy,cache,server,ssl,middleware): 为核心模块添加详细 GoDoc 文档注释
...
- config: 为 Config 和所有子配置结构添加完整文档,包含使用示例和注意事项
- stream: 为负载均衡器和服务器添加详细的参数、返回值和功能说明
- logging: 为日志格式化和输出函数添加文档,说明支持的变量替换
- handler: 为路由器、静态文件和 sendfile 处理器添加文档
- proxy: 为健康检查器和代理功能添加完整文档
- cache/server/ssl/middleware: 补充相关模块的文档注释
- config.example.yaml: 添加可信代理配置、加密套件示例,更新压缩级别说明
Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-07 15:36:09 +08:00
cd2d1a8194
refactor: 优化字符串构建方式,统一测试错误处理风格
...
- 使用 fmt.Fprintf 替代冗余的 WriteString(fmt.Sprintf) 组合
- 测试中 nil 检查使用 t.Fatal 替代 t.Error 立即终止
- .gitignore 添加 html/ 目录忽略
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 17:49:11 +08:00
262026953b
feat: 修复配置与代码实现不一致问题
...
- 添加 Stream weighted_round_robin 和 ip_hash 负载均衡算法
- 添加 Stream 配置验证 (validateStream)
- 在 Validate 函数中集成 Stream 验证
- 更新配置示例添加 trusted_proxies 字段
修复了配置文档承诺支持但代码未实现的功能:
- weighted_round_robin: 基于权重的轮询负载均衡
- ip_hash: 基于客户端 IP 的一致性哈希
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 17:29:11 +08:00
ac9153f09d
fix(proxy,stream,server): Phase 8 问题修复与功能完善
...
- WebSocket 代理集成:handleWebSocket 现调用 ProxyWebSocket 实现
- 删除 UDP Stream 冗余代码:移除 udpListener 类型及相关测试
- 热升级监听器继承:改用 net.Listen + Serve 模式支持监听器传递
- 代码格式修复:注释格式调整、字段对齐、文件末尾换行符
Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-03 14:28:00 +08:00
c70ab305b7
test(app,proxy,ssl,stream): 完善测试覆盖率
...
- app: 添加 NewApp/SetPidFile/SetLogFile/sigName 测试
- proxy: 扩展健康检查器测试
- ssl: 添加 TLS 配置和 Close 方法测试
- stream: 添加负载均衡器和 UDP 会话测试
覆盖率从 55.4% 提升至 60.3%
Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-03 13:36:43 +08:00
80936ae66b
feat(server,proxy,ssl,docs): 完成 Phase 7 功能完善
...
主要变更:
- WebSocket 代理支持 (internal/proxy/websocket.go)
- OCSP stapling 实现 (internal/ssl/ocsp.go)
- 监控状态端点 (internal/server/status.go)
- 新增 nginx 模块文档 (19-24)
- UDP 代理超时配置支持
- 多模块代码注释完善和功能增强
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 13:13:12 +08:00
9d24263918
feat(stream,server,handler): 实现 Phase 6 性能优化和热升级
...
新增功能:
- stream 模块: 流式传输支持,优化大文件和实时数据传输
- Goroutine 池: 限制并发数量,减少调度开销
- 优雅升级: 零停机热升级,继承父进程监听器
- sendfile: 零拷贝文件传输,大文件直接从内核传输
重构改进:
- App 结构体封装,支持热升级和信号处理
- 配置结构字段对齐和代码清理
- 完善错误处理和日志记录
Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-03 10:39:22 +08:00