Versions in this module Expand all Collapse all v1 v1.2.0 May 26, 2022 Changes in this version type Cache + func (c Cache) Rename(src, dst string) bool v1.1.0 Mar 27, 2022 Changes in this version + type Proxy struct + func NewProxy(c *Cache) *Proxy + func (p *Proxy) Cache() *Cache + func (p *Proxy) Delete(proxyKey string) + func (p *Proxy) Flush() + func (p *Proxy) Get(proxyKey string) (interface{}, bool) + func (p *Proxy) Items() map[string]string + func (p *Proxy) Key(proxyKey string) (string, bool) + func (p *Proxy) Proxy(mainKey, proxyKey string) + func (p *Proxy) Set(mainKey, proxyKey string, v interface{}) v1.0.0 Sep 19, 2020 Changes in this version + const DefaultExpiration + const NoExpiration + type Cache struct + func New(defaultExpiration, cleanupInterval time.Duration) *Cache + func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[string]Item) *Cache + func (c Cache) Add(k string, v interface{}, d time.Duration) error + func (c Cache) Decrement(k string, n int64) error + func (c Cache) DecrementFloat(k string, n float64) error + func (c Cache) DecrementFloat32(k string, n float32) (float32, error) + func (c Cache) DecrementFloat64(k string, n float64) (float64, error) + func (c Cache) DecrementInt(k string, n int) (int, error) + func (c Cache) DecrementInt16(k string, n int16) (int16, error) + func (c Cache) DecrementInt32(k string, n int32) (int32, error) + func (c Cache) DecrementInt64(k string, n int64) (int64, error) + func (c Cache) DecrementInt8(k string, n int8) (int8, error) + func (c Cache) DecrementUint(k string, n uint) (uint, error) + func (c Cache) DecrementUint16(k string, n uint16) (uint16, error) + func (c Cache) DecrementUint32(k string, n uint32) (uint32, error) + func (c Cache) DecrementUint64(k string, n uint64) (uint64, error) + func (c Cache) DecrementUint8(k string, n uint8) (uint8, error) + func (c Cache) DecrementUintptr(k string, n uintptr) (uintptr, error) + func (c Cache) Delete(k string) + func (c Cache) DeleteAll() map[string]Item + func (c Cache) DeleteExpired() + func (c Cache) DeleteFunc(fn Filter) map[string]Item + func (c Cache) Flush() + func (c Cache) Get(k string) (interface{}, bool) + func (c Cache) GetStale(k string) (v interface{}, expired bool, ok bool) + func (c Cache) GetWithExpiration(k string) (interface{}, time.Time, bool) + func (c Cache) Increment(k string, n int64) error + func (c Cache) IncrementFloat(k string, n float64) error + func (c Cache) IncrementFloat32(k string, n float32) (float32, error) + func (c Cache) IncrementFloat64(k string, n float64) (float64, error) + func (c Cache) IncrementInt(k string, n int) (int, error) + func (c Cache) IncrementInt16(k string, n int16) (int16, error) + func (c Cache) IncrementInt32(k string, n int32) (int32, error) + func (c Cache) IncrementInt64(k string, n int64) (int64, error) + func (c Cache) IncrementInt8(k string, n int8) (int8, error) + func (c Cache) IncrementUint(k string, n uint) (uint, error) + func (c Cache) IncrementUint16(k string, n uint16) (uint16, error) + func (c Cache) IncrementUint32(k string, n uint32) (uint32, error) + func (c Cache) IncrementUint64(k string, n uint64) (uint64, error) + func (c Cache) IncrementUint8(k string, n uint8) (uint8, error) + func (c Cache) IncrementUintptr(k string, n uintptr) (uintptr, error) + func (c Cache) ItemCount() int + func (c Cache) Items() map[string]Item + func (c Cache) Keys() []string + func (c Cache) Load(r io.Reader) error + func (c Cache) LoadFile(fname string) error + func (c Cache) Modify(k string, f func(interface{}) interface{}) bool + func (c Cache) OnEvicted(f func(string, interface{})) + func (c Cache) Pop(k string) (interface{}, bool) + func (c Cache) Replace(k string, v interface{}, d time.Duration) error + func (c Cache) Save(w io.Writer) (err error) + func (c Cache) SaveFile(fname string) error + func (c Cache) Set(k string, v interface{}, d time.Duration) + func (c Cache) SetDefault(k string, v interface{}) + func (c Cache) Touch(k string, d time.Duration) (interface{}, bool) + type Filter func(key string, item Item) (del bool, stop bool) + type Item struct + Expiration int64 + Object interface{} + func (item Item) Expired() bool Other modules containing this package zgo.at/zcache/v2