hotime/cache/type.go

25 lines
562 B
Go
Raw Normal View History

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)
GetError() *Error
SetError(err *Error)
2021-05-24 07:27:41 +08:00
Cache(key string, data ...interface{}) *Obj
// 批量操作
CachesGet(keys []string) Map // 批量获取
CachesSet(data Map, timeout ...int64) // 批量设置
CachesDelete(keys []string) // 批量删除
2021-05-24 07:27:41 +08:00
}
// 单条缓存数据
2021-05-24 07:27:41 +08:00
type cacheData struct {
time int64
data interface{}
}