Documentation ¶
Index ¶
- Constants
- type Cache
- func (c *Cache) Add(k string, v interface{}, d time.Duration) error
- func (c *Cache) Clear()
- func (c *Cache) Count() int
- func (c *Cache) Delete(k string)
- func (c *Cache) DeleteExpired()
- func (c *Cache) Get(k string) (interface{}, bool)
- func (c *Cache) Load(r io.Reader) error
- func (c *Cache) LoadFromFile(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 Item
Constants ¶
View Source
const ( // NoExpiration is for item without expiration time. NoExpiration time.Duration = -1 // DefaultExpiration is for default expiration time. DefaultExpiration time.Duration = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is the cache entity.
func (*Cache) DeleteExpired ¶
func (c *Cache) DeleteExpired()
DeleteExpired deletes the expired items.
func (*Cache) LoadFromFile ¶
LoadFromFile loads the cache from a local file.
func (*Cache) SaveToFile ¶
SaveToFile saves the cache to a local file.
Click to show internal directories.
Click to hide internal directories.