Versions in this module Expand all Collapse all v0 v0.0.2 Aug 17, 2024 Changes in this version type Cache + func (c *Cache[K, V]) GetAll() map[K]Data[V] v0.0.1 Aug 17, 2024 Changes in this version + var NegativeNumberErrMsg = errors.New("negative number") + var NumberBigErrMsg = errors.New("number too big") + var TypeErrMsg = errors.New("type error") + type Cache struct + func NewCache[K comparable, V any]() *Cache[K, V] + func (c *Cache[K, V]) Del(key K) (bool, error) + func (c *Cache[K, V]) Destroy() + func (c *Cache[K, V]) Get(key K) (V, int64, bool) + func (c *Cache[K, V]) GetBool(key K) (bool, bool, error) + func (c *Cache[K, V]) GetData(key K) (V, bool) + func (c *Cache[K, V]) GetFloat32(key K) (float32, bool, error) + func (c *Cache[K, V]) GetFloat64(key K) (float64, bool, error) + func (c *Cache[K, V]) GetInt(key K) (int, bool, error) + func (c *Cache[K, V]) GetInt64(key K) (int64, bool, error) + func (c *Cache[K, V]) GetString(key K) (string, bool, error) + func (c *Cache[K, V]) GetTTL(key K) (int64, bool) + func (c *Cache[K, V]) GetTime(key K) (time.Time, bool) + func (c *Cache[K, V]) GetUint(key K) (uint, bool, error) + func (c *Cache[K, V]) GetUint64(key K) (uint64, bool, error) + func (c *Cache[K, V]) Set(key K, val V, ttl int64) (bool, error) + func (c *Cache[K, V]) SetCallBack() SetCallback[K, V] + func (c *Cache[K, V]) SetData(key K, val V) (bool, error) + func (c *Cache[K, V]) SetFatalFunc(f func(error)) + func (c *Cache[K, V]) SetPersist(path string) error + func (c *Cache[K, V]) UpdateData(key K, val V) (bool, error) + func (c *Cache[K, V]) UpdateTTL(key K, ttl int64) (bool, error) + func (c *Cache[K, V]) UpdateTime(key K, t time.Time) (bool, error) + type Data struct + End time.Time + Val V + type SetCallback struct + func (c SetCallback[K, V]) SetDel(f func(K, Data[V])) + func (c SetCallback[K, V]) SetGet(f func(K, Data[V])) + func (c SetCallback[K, V]) SetGetData(f func(K, Data[V])) + func (c SetCallback[K, V]) SetGetTTL(f func(K, Data[V])) + func (c SetCallback[K, V]) SetSet(f func(K, Data[V])) + func (c SetCallback[K, V]) SetUpData(f func(K, Data[V])) + func (c SetCallback[K, V]) SetUpTTL(f func(K, Data[V]))