Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CacheMiss = errors.New("miss")
View Source
var EmptyKey = errors.New("empty key")
View Source
var ObjectTooBig = errors.New("object too big to fit in the cache")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Set(string, CacheObject) error
Get(string) (CacheObject, error)
Delete(string) error
Check()
Collect() map[string]CacheObject
SetCleanFunc(CacheCleanFunc)
GetHitRate() int
GetUsage() int
GetUsageRate() int
Reset()
}
type CacheCleanFunc ¶
type CacheCleanFunc func(CacheObject) error
type CacheObject ¶
type CacheObject interface {
Size() int
}
Click to show internal directories.
Click to hide internal directories.