- 20 Dec, 2025 3 commits
-
-
NepetaLemon authored
## 变更内容 ### CI/CD - 添加 GitHub Actions 工作流(test + golangci-lint) - 添加 golangci-lint 配置,启用 errcheck/govet/staticcheck/unused/depguard - 通过 depguard 强制 service 层不能直接导入 repository ### 错误处理修复 - 修复 CSV 写入、SSE 流式输出、随机数生成等未处理的错误 - GenerateRedeemCode() 现在返回 error ### 资源泄露修复 - 统一使用 defer func() { _ = xxx.Close() }() 模式 ### 代码清理 - 移除未使用的常量 - 简化 nil map 检查 - 统一代码格式 -
shaw authored
-
Forest authored
-
- 19 Dec, 2025 4 commits
-
-
Forest authored
-
Forest authored
-
shaw authored
- 新增 internal/pkg/claude 包统一管理 Claude Code 相关常量 - 统一账号测试逻辑,所有账号类型使用相同的 Claude Code 风格请求 - 网关服务使用常量包替换硬编码的 beta header 字符串
-
shaw authored
实现 Claude API 的 token 计数功能,支持 OAuth、SetupToken 和 ApiKey 三种账号类型。 特点: - 校验订阅/余额(不扣费) - 不计算用户和账号并发 - 不记录使用量 - 支持模型映射(ApiKey 账号) - 支持 OAuth 账号的指纹管理和 401 重试
-
- 18 Dec, 2025 2 commits
-
-
江西小徐 authored
问题描述: 当多个请求并发执行且使用不同代理配置时,它们会同时修改共享的 s.httpClient.Transport,导致请求可能使用错误的代理(数据泄露风险) 或意外失败。 修复方案: 为需要代理的请求创建独立的http.Client,而不是修改共享的httpClient.Transport。 改动内容: - 新增 buildUpstreamRequestResult 结构体,返回请求和可选的独立client - 修改 buildUpstreamRequest 方法,配置代理时创建独立client - 更新 Forward 方法,根据是否有代理选择合适的client
-
shaw authored
-