Documentation ¶
Index ¶
- type Cache
- func (cache *Cache) Close()
- func (cache *Cache) Delete(key interface{})
- func (cache *Cache) Get(key interface{}) (interface{}, bool)
- func (cache *Cache) Hits() int64
- func (cache *Cache) Misses() int64
- func (cache *Cache) Range(f func(key, value interface{}) bool)
- func (cache *Cache) Set(key interface{}, value interface{}, duration time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores arbitrary data with expiration time.
func New ¶
New creates a new cache that asynchronously cleans expired entries after the given time passes.
func (*Cache) Delete ¶
func (cache *Cache) Delete(key interface{})
Delete deletes the key and its value from the cache.
Click to show internal directories.
Click to hide internal directories.