Documentation ¶
Index ¶
- type IceCacheManager
- func (icm *IceCacheManager) Clear()
- func (icm *IceCacheManager) Del(key string)
- func (icm *IceCacheManager) Get(key string, value interface{}) error
- func (icm *IceCacheManager) GetCache() *freecache.Cache
- func (icm *IceCacheManager) GetExpireTime() uint32
- func (icm *IceCacheManager) GetMaxSize() uint32
- func (icm *IceCacheManager) Set(key string, value interface{}) error
- func (icm *IceCacheManager) SetWithExpire(key string, value interface{}, expire int) error
- func (icm *IceCacheManager) Update(key string, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IceCacheManager ¶
type IceCacheManager struct { MaxSize uint32 // 缓存最大容量,单位为MB ExpireTime uint32 // 缓存过期时间,单位为秒 Cache *freecache.Cache // 缓存实例 }
IceCacheManager Iceinu的缓存管理器实例,实现了一系列的缓存管理方法,便于直接使用
func NewIceCacheManager ¶
func NewIceCacheManager(maxSize, expireTime uint32) *IceCacheManager
NewIceCacheManager 创建新的缓存管理器实例
func (*IceCacheManager) Get ¶
func (icm *IceCacheManager) Get(key string, value interface{}) error
Get 获取缓存数据,value 必须是指针类型以便解码后进行填充
func (*IceCacheManager) GetCache ¶
func (icm *IceCacheManager) GetCache() *freecache.Cache
GetCache 直接获取缓存实例
func (*IceCacheManager) GetExpireTime ¶
func (icm *IceCacheManager) GetExpireTime() uint32
GetExpireTime 获取缓存过期时间
func (*IceCacheManager) GetMaxSize ¶
func (icm *IceCacheManager) GetMaxSize() uint32
GetMaxSize 获取缓存最大容量
func (*IceCacheManager) Set ¶
func (icm *IceCacheManager) Set(key string, value interface{}) error
Set 设置缓存数据
func (*IceCacheManager) SetWithExpire ¶
func (icm *IceCacheManager) SetWithExpire(key string, value interface{}, expire int) error
SetWithExpire 设置缓存数据并同时指定过期时间
func (*IceCacheManager) Update ¶
func (icm *IceCacheManager) Update(key string, value interface{}) error
Update 更新缓存数据
Click to show internal directories.
Click to hide internal directories.