freeCache

package
v0.0.0-...-2ef7dcc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSize = 64 //64M

)

Functions

func NewFreeCache

func NewFreeCache() icache.ICache

Types

type FreeCache

type FreeCache struct {
	Free *freecache.Cache
}

func NewFree

func NewFree(m int) *FreeCache

该函数是可以在任意地方使用,初始化Free进程缓存

func (*FreeCache) CacheStatus

func (free *FreeCache) CacheStatus() map[string]interface{}

获取cache状态

func (*FreeCache) ClearAll

func (free *FreeCache) ClearAll() error

清出所有缓存

func (*FreeCache) Decr

func (free *FreeCache) Decr(key string) error

对key值为int64的减1

func (*FreeCache) Delete

func (free *FreeCache) Delete(key string) error

删除key

func (*FreeCache) Get

func (free *FreeCache) Get(key string, value interface{}) error

推荐使用,

func (*FreeCache) GetMulti

func (free *FreeCache) GetMulti(keys []string, values []interface{}) error

批量获取keys

func (*FreeCache) Incr

func (free *FreeCache) Incr(key string) error

对key值为int64的加1

func (*FreeCache) IsExist

func (free *FreeCache) IsExist(key string) (bool, error)

判断指定key是否存在

func (*FreeCache) Put

func (free *FreeCache) Put(key string, val interface{}, timeout time.Duration) error

设置缓存

func (*FreeCache) StartAndGC

func (cache *FreeCache) StartAndGC(config string) error

在beego框架中,注册时会自动执行该函数初始化

func (*FreeCache) String

func (free *FreeCache) String() string

输出cache状态

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL