Versions in this module Expand all Collapse all v2 v2.3.0 Apr 21, 2026 v2.1.0 Feb 9, 2026 Changes in this version + type Cache struct + func New(lruCap ...int) *Cache + func (c *Cache) Clear(ctx context.Context) error + func (c *Cache) Close(ctx context.Context) error + func (c *Cache) Contains(ctx context.Context, key any) (bool, error) + func (c *Cache) ContainsKey(ctx context.Context, key any) bool + func (c *Cache) Data(ctx context.Context) (map[any]any, error) + func (c *Cache) Get(ctx context.Context, key any) (*gvar.Var, error) + func (c *Cache) GetExpire(ctx context.Context, key any) (time.Duration, error) + func (c *Cache) GetInt(ctx context.Context, key any) (int, error) + func (c *Cache) GetMap(ctx context.Context, key any) (map[string]any, error) + func (c *Cache) GetMapStrStr(ctx context.Context, key any) (map[string]string, error) + func (c *Cache) GetMapStrVar(ctx context.Context, key any) (map[string]*gvar.Var, error) + func (c *Cache) GetOrSet(ctx context.Context, key any, value any, duration time.Duration) (*gvar.Var, error) + func (c *Cache) GetOrSetFunc(ctx context.Context, key any, f gcache.Func, duration time.Duration) (*gvar.Var, error) + func (c *Cache) GetOrSetFuncLock(ctx context.Context, key any, f gcache.Func, duration time.Duration) (*gvar.Var, error) + func (c *Cache) GetStr(ctx context.Context, key any) (string, error) + func (c *Cache) GetVal(ctx context.Context, key any) any + func (c *Cache) Keys(ctx context.Context) ([]any, error) + func (c *Cache) Remove(ctx context.Context, keys ...any) (lastValue *gvar.Var, err error) + func (c *Cache) Set(ctx context.Context, key any, value any, duration time.Duration) error + func (c *Cache) SetIfNotExist(ctx context.Context, key any, value any, duration time.Duration) (bool, error) + func (c *Cache) SetIfNotExistFunc(ctx context.Context, key any, f gcache.Func, duration time.Duration) (bool, error) + func (c *Cache) SetIfNotExistFuncLock(ctx context.Context, key any, f gcache.Func, duration time.Duration) (bool, error) + func (c *Cache) SetMap(ctx context.Context, data map[any]any, duration time.Duration) error + func (c *Cache) Size(ctx context.Context) (int, error) + func (c *Cache) Update(ctx context.Context, key any, value any) (oldValue *gvar.Var, exist bool, err error) + func (c *Cache) UpdateExpire(ctx context.Context, key any, duration time.Duration) (oldDuration time.Duration, err error) + func (c *Cache) Values(ctx context.Context) ([]any, error) Other modules containing this package github.com/iimeta/fastapi-admin