cachemap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalCacheOpMap = CacheOpMap{}
)

Functions

This section is empty.

Types

type CacheOpMap

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

func (*CacheOpMap) CacheOperation

func (cm *CacheOpMap) CacheOperation(op string, key interface{}, opFunc OpFunc) (data expires.DataExpires)

func (*CacheOpMap) CacheOperationWithError

func (cm *CacheOpMap) CacheOperationWithError(op string, key interface{}, opFunc OpFuncWithError) (data expires.DataExpires, err error)

func (*CacheOpMap) ClearInvalidate

func (cm *CacheOpMap) ClearInvalidate()

ClearInvalidate 清除已过期的数据(一般用不到)

func (*CacheOpMap) LazyInitCachePoolOp

func (cm *CacheOpMap) LazyInitCachePoolOp(op string) CacheUnit

func (*CacheOpMap) PrintAll

func (cm *CacheOpMap) PrintAll()

PrintAll 输出所有缓冲项目

func (*CacheOpMap) RemoveCachePoolOp

func (cm *CacheOpMap) RemoveCachePoolOp(op string)

type CacheUnit

type CacheUnit interface {
	Delete(key interface{})
	Load(key interface{}) (value expires.DataExpires, ok bool)
	LoadOrStore(key interface{}, value expires.DataExpires) (actual expires.DataExpires, loaded bool)
	Range(f func(key interface{}, value expires.DataExpires) bool)
	Store(key interface{}, value expires.DataExpires)
	LockKey(key interface{})
	UnlockKey(key interface{})
}

type OpFunc

type OpFunc func() expires.DataExpires

type OpFuncWithError

type OpFuncWithError func() (expires.DataExpires, error)

Jump to

Keyboard shortcuts

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