Documentation ¶
Index ¶
- func ClearExpireNode()
- func Del(key string) bool
- func Exists(key string) bool
- func Flush() bool
- func Get(key string) (interface{}, bool)
- func InitMCache()
- func Keys() int64
- func MStat(t *testing.T)
- func NewLinkedList() *linkedList
- func Set(key string, val interface{}, expire int64)
- func SetMaxMemory(size string) bool
- func TestGet(t *testing.T)
- func TestSet(t *testing.T)
- type Cache
- func (c *Cache) ClearExpireNode()
- func (c *Cache) Del(key string) bool
- func (c *Cache) Exists(key string) bool
- func (c *Cache) Flush() bool
- func (c *Cache) Get(key string) (interface{}, bool)
- func (c *Cache) Keys() int64
- func (c *Cache) Set(key string, val interface{}, expire time.Duration)
- func (c *Cache) SetMaxMemory(size string) bool
- type ICache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearExpireNode ¶
func ClearExpireNode()
func InitMCache ¶
func InitMCache()
func NewLinkedList ¶
func NewLinkedList() *linkedList
func SetMaxMemory ¶
Types ¶
type Cache ¶
type Cache struct { SizeStr string //1KB,100KB,1MB,2MB,1GB Interval int // 多长时间执行一次清理任务,操作单位秒 // contains filtered or unexported fields }
func (*Cache) ClearExpireNode ¶
func (c *Cache) ClearExpireNode()
func (*Cache) SetMaxMemory ¶
type ICache ¶
type ICache interface { //size 是⼀一个字符串串。⽀支持以下参数: 1KB,100KB,1MB,2MB,1GB 等 SetMaxMemory(size string) bool // 设置⼀一个缓存项,并且在expire时间之后过期 Set(key string, val interface{}, expire time.Duration) // 获取⼀一个值 Get(key string) (interface{}, bool) // 删除⼀一个值 Del(key string) bool // 检测⼀一个值 是否存在 Exists(key string) bool // 情况所有值 Flush() bool // 返回所有的key 多少 Keys() int64 //清理过期的节点 ClearExpireNode() }
Click to show internal directories.
Click to hide internal directories.