Versions in this module Expand all Collapse all v0 v0.1.2 May 12, 2020 v0.1.1 May 4, 2020 Changes in this version type Config + Enable bool v0.1.0 May 3, 2020 Changes in this version + const DefaultExpiration + const NoExpiration + func Add(k string, v interface{}, d time.Duration) (err error) + func Get(key string) (interface{}, bool) + func Init() + func Set(k string, v interface{}, d time.Duration) + type Cache struct + File string + Items map[string]Item + var Obj Cache + func NewCache(defaultExpiration, gcInterval time.Duration, file string) *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) LoadFile(file 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(file string) error + func (c *Cache) Set(k string, v interface{}, d time.Duration) + func (c *Cache) StopGc() + type Config struct + Expiration int32 + RealtimeSave bool + SavefileCycle int32 + SavefilePath string + type Item struct + Expiration int64 + Object interface{} + func (item Item) Expired() bool