redis/CHANGELOG.md

43 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CHANGELOG - redis
## v1.0.2 (2026-05-04)
- **Naming Standardization**:
- 全面将 `Id` 命名规范化为 `ID`(涉及 `IDMaker`, `NewIDMaker`, `userInfo.ID` 等)。
- **Performance & Efficiency**:
- 优化 `commands.go`: 所有 Redis 命令调用改为参数化传递,消除字符串拼接,提升解析性能并防止 Key 包含空格的问题。
- 优化 `redis.go`: 在 `do` 方法中增加判断,若命令不含空格则跳过 `Split` 处理,减少内存分配。
- **Modernity & Robustness**:
- 升级错误处理逻辑,使用 `errors.As``errors.Is` 替换旧式的类型断言。
- 增强 `Result.To` 方法,增加对目标对象非空指针的强制校验。
- 完善 `do` 方法对 `values``nil` 指针检查。
- **Cleanup**:
- 删除了冗余的 `AI.md` 文件。
- **Testing**:
- 新增 `TestRetry` 用例,验证连接异常时的自动恢复逻辑。
## v1.0.1 (2026-05-03)
- **Security & Stability**:
- 修复了 `Pub/Sub` 模块中 `subs` map 和 `subConn` 的并发访问竞争风险Race Condition引入 `subLock` 互斥锁。
- **Cleanup**:
- 移除了 `Redis` 结构体中冗余的 `ReadTimeout` 字段,统一由 `Config` 管理。
- **Testing & CI/CD**:
- 新增 `TestMain` 自动环境检查,若 Redis 不可用则优雅跳过测试,不中断 CI 流程。
- 新增 `TestIdMaker` 覆盖分布式 ID 生成逻辑。
- 新增 `bench_test.go`,建立性能基准测试。
- 新增 `TEST.md` 记录测试覆盖场景与 Benchmark 结果。
## v1.0.0 (2026-05-03)
- **Repo Migration**: 从 `@ssgo/redis` 迁移至 `apigo.cc/go/redis`
- **Standard Realignment**:
- 依赖全面切换至 `apigo.cc/go/*` 标准库。
- 适配 Go 1.25.0。
- **Feature Enhancements**:
- **Generics**: 为 `Result` 引入泛型 `To[T]` 支持,消除类型断言摩擦。
- **Memory Safety**: 集成 `go/safe` 对 Redis 密码进行实时加解密与内存锁定,防止内存泄漏敏感信息。
- **Auto-Serialization**: 优化了 `Do` 方法,支持对 Struct/Map/Slice 自动进行 JSON 序列化(优先支持 Marshaler 接口)。
- **Distributed ID**: 深度集成 `go/id` 核心,提供更高性能的 Redis 序列号预取机制。
- **Refactoring**:
- 移除了冗余的 `interface{}`,全面改用 `any`
- 规范化了 API 命名,统一使用 `GetUpperName` 进行 Struct 字段映射。
- 增强了连接重试机制,支持对网络波动和服务器重启的自动恢复。