Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Add(key any, value any, lifeSpan time.Duration)
- func (c *Cache) Clear() bool
- func (cache *Cache) Close()
- func (cache *Cache) Delete(key any)
- func (cache *Cache) Get(key any) (any, bool)
- func (c *Cache) IsExist(key any) bool
- func (cache *Cache) Range(f func(key, value any) bool)
- func (cache *Cache) Set(key any, value any, duration time.Duration)
- func (c *Cache) Value(key any) (any, 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) 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.