Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Add(key interface{}, value interface{}, lifeSpan time.Duration)
- func (c *Cache) Clear() bool
- func (cache *Cache) Close()
- func (cache *Cache) Delete(key interface{})
- func (cache *Cache) Get(key interface{}) (interface{}, bool)
- func (c *Cache) IsExist(key interface{}) bool
- func (cache *Cache) Range(f func(key, value interface{}) bool)
- func (cache *Cache) Set(key interface{}, value interface{}, duration time.Duration)
- func (c *Cache) Value(key interface{}) (interface{}, bool)
- type MyCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v1.1.15
type Cache struct {
// contains filtered or unexported fields
}
func New ¶ added in v1.1.15
New creates a new cache that asynchronously cleans expired entries after the given time passes.
func (*Cache) Close ¶ added in v1.1.15
func (cache *Cache) Close()
Close closes the cache and frees up resources.
func (*Cache) Delete ¶ added in v1.1.15
func (cache *Cache) Delete(key interface{})
Delete deletes the key and its value from the cache.
func (*Cache) Range ¶ added in v1.1.15
Range calls f sequentially for each key and value present in the cache. If f returns false, range stops the iteration.
Click to show internal directories.
Click to hide internal directories.