Versions in this module Expand all Collapse all v1 v1.2.0 Apr 28, 2022 Changes in this version + const NoExpiration + type Cache struct + func NewCache(defaultExpiration, gcInterval time.Duration) (c *Cache) + func (c *Cache) Add(k string, v interface{}, d time.Duration) error + func (c *Cache) Count() int + func (c *Cache) Delete(k string) + func (c *Cache) DeleteExpired() + func (c *Cache) Flush() + func (c *Cache) Get(k string) (interface{}, bool) + func (c *Cache) Load(r io.Reader) error + func (c *Cache) LoadFromFile(filename string) error + func (c *Cache) Replace(k string, v interface{}, d time.Duration) error + func (c *Cache) Save(w io.Writer) (err error) + func (c *Cache) SaveToFile(filename string) error + func (c *Cache) Set(k string, v interface{}, d time.Duration, isSlide bool) + func (c *Cache) StopGc() + type Item struct + Dur time.Duration + Expiration int64 + IsSlide bool + Object interface{} + func (item Item) IsExpired() bool