32 Commits

Author SHA1 Message Date
xfy
afbbc3a951 chore: release v0.4.1 2026-06-10 13:54:26 +08:00
xfy
f12ffd180f chore: release v0.4.0
- Update CHANGELOG.md for v0.4.0
- Update Makefile FALLBACK_VERSION to 0.4.0
- Fix lint warnings (godoc comments, goconst)
- Clean up code formatting
2026-06-09 15:59:36 +08:00
xfy
c847f6036d chore: release v0.3.0 2026-06-05 14:24:39 +08:00
xfy
170e0f1942 feat(Makefile): add freebsd and openbsd build targets 2026-06-05 10:17:58 +08:00
xfy
0db14c239c chore(Makefile): optimize targets and fix inconsistencies
- Auto-detect VERSION from git tags with fallback
- Extract mkdir as order-only prerequisite to eliminate duplication
- Add PERF_GCFLAGS/PERF_ASMFLAGS to cross-platform builds and install
- Merge bench-regression into bench-check, unify file naming
- Fix bench scope and sampling consistency (internal/ only, -run=^$)
- Fix test-cover scope to avoid un-tagged integration/e2e code
- Fix deprecated go get -u ./... to go get -u
- Add clean-mod target, clean benchmark artifacts in clean
- Remove phantom build-prod/build-perf from help
- Split docker long line for readability
- Add .PHONY declarations for all targets
2026-06-05 10:15:21 +08:00
xfy
c02008cc6a chore(build): remove tmpdir workaround from Makefile
💘 Generated with Crush

Assisted-by: mimo-v2.5 via Crush <crush@charm.land>
2026-05-06 17:43:13 +08:00
xfy
1e01d4829d chore: release v0.2.2
Update version to 0.2.2 and add comprehensive CHANGELOG entry
covering 130+ commits since v0.2.1: autoindex module, nginx config
converter, ETag/304 support, layered caching, stale cache fallback,
slow start load balancing, performance optimizations, and more.

💘 Generated with Crush

Assisted-by: mimo-v2.5-pro via Crush <crush@charm.land>
2026-04-30 16:56:14 +08:00
xfy
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
xfy
e7306a0c72 perf: optimize ConsistentHash and RateLimiter for better concurrency
- ConsistentHash: reuse main hash ring in SelectExcludingByKey instead of
  rebuilding per call, reducing memory allocation from 369KB to 1.8KB (99.5%)
- RateLimiter: replace single RWMutex with 16-segment sharded locks to
  reduce lock contention in high-concurrency scenarios
- TLS SessionTickets: add warning log when KeyFile is empty to alert
  users about session invalidation after restart

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 10:23:19 +08:00
xfy
0de9922e7d fix(makefile): restrict bench target to internal directory
- Change ./... to ./internal/... to avoid scanning lib/fasthttp
- Add -run=^$$ to skip regular tests, run only benchmarks
- Properly escape $ in Makefile with $$

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 00:05:54 +08:00
xfy
7d2c71c921 chore(build): 配置 TMPDIR 避免 tmpfs 空间不足
- Makefile 设置 TMPDIR 为项目 tmp 目录
- 更新 docs/prompts.md 基准测试命令示例

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 14:57:12 +08:00
xfy
7da9ffcb6b chore(bench): 扩展 Makefile 基准测试命令
- bench 目标输出到 bench-results.txt,count=5 采样
- 添加 bench-regression 目标,使用阈值配置检测回归

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 10:33:15 +08:00
xfy
2cb10eb749 perf(e2e): 并行化 E2E 测试,从 ~2h 降至 ~102s
- testutil: 用 sync.Once 缓存 LollyImageAvailable 结果
- testutil: 原子计数器替代时间戳避免容器名竞态
- testutil: SetupProxyTest 接受 suffix 参数生成独立 Docker 网络
- testutil: CleanupProxyTest 显式调用 network.Remove() 清理
- testutil: 移除死代码 SetupProxyTestEnv/ProxyTestEnv
- testutil: HealthCheckWaitTimeout 30s→15s, DefaultTestTimeout 180s→120s
- e2e: 所有 107 个测试函数添加 t.Parallel()
- e2e: 替换 65 处硬编码 30*time.Second 为常量
- make: test-all 三类测试并行运行,显式 PID wait 收集退出码
- make: test-e2e 添加 -parallel 4 flag

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 13:19:46 +08:00
xfy
1be6480f5c feat(e2e): 添加重试机制和测试覆盖率支持
- 新增 testutil/retry.go 提供重试工具函数
  - WaitForCondition: 等待条件满足
  - WaitForNoError: 等待操作无错误
  - WaitForHealthy: 等待服务健康
  - Poll: 简化轮询接口
- 新增 testutil/retry_test.go 单元测试
- container.go 添加 Logs() 方法用于诊断
- Makefile 新增 test-e2e-cover 和 test-e2e-short 目标
- 重构 healthcheck 和 loadbalance 测试使用重试机制

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 16:07:17 +08:00
xfy
c6df735caa feat(make): 添加 act 命令用于本地运行 CI
- make act: 运行完整 CI
- make act-unit: 仅运行单元测试 job

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-24 08:11:05 +08:00
xfy
cae8856f11 build(make): 将 check 目标改为使用 test-all
将 check 目标从 test 改为 test-all,确保运行完整测试套件
(包括单元测试、集成测试和 E2E 测试)。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 18:28:15 +08:00
xfy
cc19328a81 ci: 添加分层测试 CI 工作流
- 添加 GitHub Actions 工作流支持 L1/L2/L3 三层测试
- Makefile 新增 test-integration、test-e2e、test-all 目标
- 支持单元测试、集成测试、E2E 测试分离执行

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 14:58:52 +08:00
xfy
cfb27a9b9d style(make): 修复文件末尾缺少换行符
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 18:26:26 +08:00
xfy
e9c24e5671 chore(make): 增强 clean 目标清理 Go 缓存
添加 go clean -cache -testcache 清理构建缓存,
注释保留 go clean -modcache 供需要时启用。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 18:25:46 +08:00
xfy
e05cf8a674 refactor(version): 模块化版本信息
将版本信息从 app.go 移至独立的 version 包,便于多模块引用。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 18:07:21 +08:00
xfy
8f6991fb3d chore: bump version to 0.2.1
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 15:07:28 +08:00
xfy
75317b44dd build(docker): 添加 Docker 构建支持
- Dockerfile: 添加 GOPROXY/GOSUMDB 代理设置,优化编译参数
- Makefile: 添加 docker/docker-push/docker-clean 命令

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 14:12:32 +08:00
xfy
73ef7f4916 fix(lint): 修复剩余 lint 错误
- 统一八进制权限格式为 Go 1.13+ 风格 (0o644/0o755)
- 调整 Target 结构体字段顺序优化内存对齐
- 合并相邻的全局变量声明
- 删除多余空行
- 更新 Makefile 使用 gofumpt 替代 goimports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 16:50:14 +08:00
xfy
191f6f39ba feat(makefile): 添加 Windows 平台构建兼容性
- BUILD_TIME 增加错误容忍处理
- GO_VERSION 改用 go env GOVERSION 获取
- 新增 Windows 可执行文件 .exe 扩展名支持
- 构建目标统一使用 $(EXECUTABLE) 变量

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 13:41:17 +08:00
xfy
52a210ed19 chore(config): 调整 golangci-lint 和 Makefile 配置
golangci.yml:
- 排除 lua 包的 revive stuttering 检查
- 配置 revive exported 规则禁用 stuttering 检查

Makefile:
- 简化构建命令,移除冗余的 build 和 build-prod 区分
- 默认 build 使用最大性能优化构建

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 16:55:47 +08:00
xfy
904efa9842 chore(release): 发布 v0.2.0 版本
- 更新 CHANGELOG 记录所有新增功能和变更
- 版本号升级至 0.2.0
- 调整 Makefile 构建命令结构

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 09:48:35 +08:00
xfy
7a2b1d7e03 chore(makefile): 使用 goimports 替代 go fmt 格式化代码
goimports 可同时处理格式化和导入排序。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 17:58:18 +08:00
xfy
8ecb48e246 feat(build): 为所有构建命令启用静态链接支持
- 新增 CGO_DISABLE 变量(CGO_ENABLED=0)
- 所有构建目标(build、build-prod、build-perf、build-pgo)均使用静态链接
- 跨平台构建(linux、darwin、windows)同样启用静态链接
- 更新 help 文案反映静态构建特性

静态链接确保二进制文件无外部依赖,便于容器化部署。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 14:54:05 +08:00
xfy
766e9255fa feat(config,server,makefile): 新增 pprof 性能分析端点支持
- 新增 PprofConfig 配置结构,支持路径和 IP 访问控制
- 实现 PprofHandler 处理器,提供 CPU/heap/goroutine/block/mutex profile
- Makefile 新增 build-perf、build-pgo、pgo-collect 目标
- 支持 PGO (Profile-Guided Optimization) 构建

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-07 18:21:03 +08:00
xfy
355d7a18ae feat(makefile,scripts,ci): 新增基准测试基础设施与回归检测
- Makefile 添加 bench-stat/bench-compare/bench-save/bench-check 命令
- 新增 Python 回归检测脚本 check_regression.py
- 新增 GitHub Actions 基准测试工作流

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-07 17:05:42 +08:00
xfy
77b0eccf4c refactor(app): 将应用逻辑抽取到 internal/app 包
将版本信息和核心运行逻辑从 main.go 移至 internal/app/app.go,
main.go 仅保留 CLI 参数解析和入口调用。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-02 14:12:06 +08:00
xfy
56c6ba3731 chore(build): 添加 Makefile 构建脚本和程序入口
- Makefile: 跨平台构建、测试、代码质量检查命令
- main.go: 程序入口,支持版本信息注入

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-02 13:23:54 +08:00