2021-05-24 07:27:41 +08:00
|
|
|
package cache
|
|
|
|
|
|
|
|
|
|
import (
|
2022-03-13 01:12:29 +08:00
|
|
|
. "code.hoteas.com/golang/hotime/common"
|
2021-05-24 07:27:41 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type CacheIns interface {
|
|
|
|
|
//set(key string, value interface{}, time int64)
|
|
|
|
|
//get(key string) interface{}
|
|
|
|
|
//delete(key string)
|
2021-05-28 22:52:22 +08:00
|
|
|
GetError() *Error
|
|
|
|
|
SetError(err *Error)
|
2021-05-24 07:27:41 +08:00
|
|
|
Cache(key string, data ...interface{}) *Obj
|
2026-01-30 17:51:43 +08:00
|
|
|
// 批量操作
|
|
|
|
|
CachesGet(keys []string) Map // 批量获取
|
|
|
|
|
CachesSet(data Map, timeout ...int64) // 批量设置
|
|
|
|
|
CachesDelete(keys []string) // 批量删除
|
2021-05-24 07:27:41 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-22 02:44:53 +08:00
|
|
|
// 单条缓存数据
|
2021-05-24 07:27:41 +08:00
|
|
|
type cacheData struct {
|
|
|
|
|
time int64
|
|
|
|
|
data interface{}
|
|
|
|
|
}
|