Versions in this module Expand all Collapse all v0 v0.1.0 Jan 6, 2021 Changes in this version + const DefaultExpiration + const DefaultForRangeExpiration + const NoExpiration + type Cache struct + func New(defaultExpiration, cleanupInterval time.Duration) *Cache + func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[interface{}]Item) *Cache + func (c Cache) Add(k interface{}, x interface{}, d time.Duration) error + func (c Cache) Decrement(k interface{}, n int64) error + func (c Cache) DecrementFloat(k interface{}, n float64) error + func (c Cache) DecrementFloat32(k interface{}, n float32) (float32, error) + func (c Cache) DecrementFloat64(k interface{}, n float64) (float64, error) + func (c Cache) DecrementInt(k interface{}, n int) (int, error) + func (c Cache) DecrementInt16(k interface{}, n int16) (int16, error) + func (c Cache) DecrementInt32(k interface{}, n int32) (int32, error) + func (c Cache) DecrementInt64(k interface{}, n int64) (int64, error) + func (c Cache) DecrementInt8(k interface{}, n int8) (int8, error) + func (c Cache) DecrementUint(k interface{}, n uint) (uint, error) + func (c Cache) DecrementUint16(k interface{}, n uint16) (uint16, error) + func (c Cache) DecrementUint32(k interface{}, n uint32) (uint32, error) + func (c Cache) DecrementUint64(k interface{}, n uint64) (uint64, error) + func (c Cache) DecrementUint8(k interface{}, n uint8) (uint8, error) + func (c Cache) DecrementUintptr(k interface{}, n uintptr) (uintptr, error) + func (c Cache) Delete(k interface{}) + func (c Cache) DeleteExpired() + func (c Cache) Flush() + func (c Cache) Get(k interface{}) (interface{}, bool) + func (c Cache) GetWithExpiration(k interface{}) (interface{}, time.Time, bool) + func (c Cache) Increment(k interface{}, n int64) error + func (c Cache) IncrementFloat(k interface{}, n float64) error + func (c Cache) IncrementFloat32(k interface{}, n float32) (float32, error) + func (c Cache) IncrementFloat64(k interface{}, n float64) (float64, error) + func (c Cache) IncrementInt(k interface{}, n int) (int, error) + func (c Cache) IncrementInt16(k interface{}, n int16) (int16, error) + func (c Cache) IncrementInt32(k interface{}, n int32) (int32, error) + func (c Cache) IncrementInt64(k interface{}, n int64) (int64, error) + func (c Cache) IncrementInt8(k interface{}, n int8) (int8, error) + func (c Cache) IncrementUint(k interface{}, n uint) (uint, error) + func (c Cache) IncrementUint16(k interface{}, n uint16) (uint16, error) + func (c Cache) IncrementUint32(k interface{}, n uint32) (uint32, error) + func (c Cache) IncrementUint64(k interface{}, n uint64) (uint64, error) + func (c Cache) IncrementUint8(k interface{}, n uint8) (uint8, error) + func (c Cache) IncrementUintptr(k interface{}, n uintptr) (uintptr, error) + func (c Cache) ItemCount() int + func (c Cache) Items() map[interface{}]Item + func (c Cache) Load(r io.Reader) error + func (c Cache) LoadFile(fname string) error + func (c Cache) OnEvicted(f func(interface{}, interface{})) + func (c Cache) Replace(k interface{}, x 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 interface{}, x interface{}, d time.Duration) + func (c Cache) SetDefault(k interface{}, x interface{}) + type Item struct + Expiration int64 + Object interface{} + func (item Item) Expired() bool