Documentation ¶
Index ¶
- type Cache
- func (cache *Cache) Get(key string) (val any, ok bool)
- func (cache *Cache) GetBytes(key string) []byte
- func (cache *Cache) GetFloat(key string) float64
- func (cache *Cache) GetInt(key string) int
- func (cache *Cache) GetString(key string) string
- func (cache *Cache) Set(key string, val any, expire ...time.Duration)
- type EvictionPolicy
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EvictionPolicy ¶ added in v1.0.6
type EvictionPolicy byte
const ( PolicyLRU EvictionPolicy = iota PolicyLFU )
type Option ¶ added in v1.1.0
type Option struct { Capacity int //最大缓存数, 默认1024条 Policy EvictionPolicy //缓存清理策略,默认LRU }
Click to show internal directories.
Click to hide internal directories.