Versions in this module Expand all Collapse all v3 v3.0.0 Nov 1, 2023 Changes in this version + const DefaultExpiration + const NoExpiration + func Decrement(c *Cache[K, V], k K, v V) bool + func Increment(c *Cache[K, V], k K, v V) bool + type Cache struct + func New(defaultExpiration, cleanupInterval time.Duration) *Cache[K, V] + func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[K]Item[V]) *Cache[K, V] + func (c Cache) Add(k K, x V, d time.Duration) error + func (c Cache) Delete(k K) + func (c Cache) DeleteExpired() + func (c Cache) Flush() + func (c Cache) Get(k K) (V, bool) + func (c Cache) GetWithExpiration(k K) (V, time.Time, bool) + func (c Cache) ItemCount() int + func (c Cache) Items() map[K]Item[V] + func (c Cache) Load(r io.Reader) error + func (c Cache) LoadFile(fname string) error + func (c Cache) OnEvicted(f func(K, V)) + func (c Cache) Replace(k K, x V, 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 K, x V, d time.Duration) + func (c Cache) SetDefault(k K, x V) + type Item struct + Expiration int64 + Object T + func (item Item[T]) Expired() bool + type Number interface Other modules containing this package github.com/graydovee/gocache