cache

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 2 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyCache

type MyCache struct {
	// contains filtered or unexported fields
}

func OnGetCache

func OnGetCache(cachename string) *MyCache

初始化一个cache cachename 缓存名字

func (*MyCache) Add

func (mc *MyCache) Add(key interface{}, value interface{}, lifeSpan time.Duration) *cache2go.CacheItem

添加一个缓存 lifeSpan:缓存时间,0表示永不超时

func (*MyCache) Clear

func (mc *MyCache) Clear() bool

清空表內容

func (*MyCache) Delete

func (mc *MyCache) Delete(key interface{}) error

删除一个cache

func (*MyCache) GetCache2go

func (mc *MyCache) GetCache2go() *cache2go.CacheTable

获取原始cache2go操作类

func (*MyCache) IsExist

func (mc *MyCache) IsExist(key interface{}) bool

判断key是否存在

func (*MyCache) Value

func (mc *MyCache) Value(key interface{}) (value interface{}, b bool)

Jump to

Keyboard shortcuts

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