hotime/cache/type.go
hoteas 3d83c41905 feat(cache): 增加批量操作支持以提升性能
- 在 HoTimeCache 中新增 SessionsGet、SessionsSet 和 SessionsDelete 方法,支持批量获取、设置和删除 Session 缓存
- 优化缓存逻辑,减少数据库写入次数,提升性能
- 更新文档,详细说明批量操作的使用方法和性能对比
- 添加调试日志记录,便于追踪批量操作的执行情况
2026-01-30 17:51:43 +08:00

25 lines
562 B
Go

package cache
import (
. "code.hoteas.com/golang/hotime/common"
)
type CacheIns interface {
//set(key string, value interface{}, time int64)
//get(key string) interface{}
//delete(key string)
GetError() *Error
SetError(err *Error)
Cache(key string, data ...interface{}) *Obj
// 批量操作
CachesGet(keys []string) Map // 批量获取
CachesSet(data Map, timeout ...int64) // 批量设置
CachesDelete(keys []string) // 批量删除
}
// 单条缓存数据
type cacheData struct {
time int64
data interface{}
}