Versions in this module Expand all Collapse all v1 v1.16.10 Dec 2, 2021 Changes in this version + func Contains(key interface{}) (bool, error) + func Data() (map[interface{}]interface{}, error) + func Get(key interface{}) (interface{}, error) + func GetExpire(key interface{}) (time.Duration, error) + func GetOrSet(key interface{}, value interface{}, duration time.Duration) (interface{}, error) + func GetOrSetFunc(key interface{}, f func() (interface{}, error), duration time.Duration) (interface{}, error) + func GetOrSetFuncLock(key interface{}, f func() (interface{}, error), duration time.Duration) (interface{}, error) + func GetVar(key interface{}) (*gvar.Var, error) + func KeyStrings() ([]string, error) + func Keys() ([]interface{}, error) + func Remove(keys ...interface{}) (value interface{}, err error) + func Removes(keys []interface{}) + func Set(key interface{}, value interface{}, duration time.Duration) error + func SetIfNotExist(key interface{}, value interface{}, duration time.Duration) (bool, error) + func Sets(data map[interface{}]interface{}, duration time.Duration) error + func Size() (int, error) + func Update(key interface{}, value interface{}) (oldValue interface{}, exist bool, err error) + func UpdateExpire(key interface{}, duration time.Duration) (oldDuration time.Duration, err error) + func Values() ([]interface{}, error) + type Adapter interface + Clear func(ctx context.Context) error + Close func(ctx context.Context) error + Contains func(ctx context.Context, key interface{}) (bool, error) + Data func(ctx context.Context) (map[interface{}]interface{}, error) + Get func(ctx context.Context, key interface{}) (interface{}, error) + GetExpire func(ctx context.Context, key interface{}) (time.Duration, error) + GetOrSet func(ctx context.Context, key interface{}, value interface{}, ...) (interface{}, error) + GetOrSetFunc func(ctx context.Context, key interface{}, f func() (interface{}, error), ...) (interface{}, error) + GetOrSetFuncLock func(ctx context.Context, key interface{}, f func() (interface{}, error), ...) (interface{}, error) + Keys func(ctx context.Context) ([]interface{}, error) + Remove func(ctx context.Context, keys ...interface{}) (value interface{}, err error) + Set func(ctx context.Context, key interface{}, value interface{}, ...) error + SetIfNotExist func(ctx context.Context, key interface{}, value interface{}, ...) (bool, error) + Sets func(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error + Size func(ctx context.Context) (size int, err error) + Update func(ctx context.Context, key interface{}, value interface{}) (oldValue interface{}, exist bool, err error) + UpdateExpire func(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error) + Values func(ctx context.Context) ([]interface{}, error) + type Cache struct + func Ctx(ctx context.Context) *Cache + func New(lruCap ...int) *Cache + func (c *Cache) Clear() error + func (c *Cache) Clone() *Cache + func (c *Cache) Close() error + func (c *Cache) Contains(key interface{}) (bool, error) + func (c *Cache) Ctx(ctx context.Context) *Cache + func (c *Cache) Data() (map[interface{}]interface{}, error) + func (c *Cache) Get(key interface{}) (interface{}, error) + func (c *Cache) GetExpire(key interface{}) (time.Duration, error) + func (c *Cache) GetOrSet(key interface{}, value interface{}, duration time.Duration) (interface{}, error) + func (c *Cache) GetOrSetFunc(key interface{}, f func() (interface{}, error), duration time.Duration) (interface{}, error) + func (c *Cache) GetOrSetFuncLock(key interface{}, f func() (interface{}, error), duration time.Duration) (interface{}, error) + func (c *Cache) GetVar(key interface{}) (*gvar.Var, error) + func (c *Cache) KeyStrings() ([]string, error) + func (c *Cache) Keys() ([]interface{}, error) + func (c *Cache) Remove(keys ...interface{}) (value interface{}, err error) + func (c *Cache) Removes(keys []interface{}) error + func (c *Cache) Set(key interface{}, value interface{}, duration time.Duration) error + func (c *Cache) SetAdapter(adapter Adapter) + func (c *Cache) SetIfNotExist(key interface{}, value interface{}, duration time.Duration) (bool, error) + func (c *Cache) Sets(data map[interface{}]interface{}, duration time.Duration) error + func (c *Cache) Size() (size int, err error) + func (c *Cache) Update(key interface{}, value interface{}) (oldValue interface{}, exist bool, err error) + func (c *Cache) UpdateExpire(key interface{}, duration time.Duration) (oldDuration time.Duration, err error) + func (c *Cache) Values() ([]interface{}, error)