Documentation
¶
Index ¶
- type 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) GetMapStrStr ¶
func (*Cache) GetMapStrVar ¶
func (*Cache) GetOrSetFunc ¶
func (*Cache) GetOrSetFuncLock ¶
func (*Cache) SetIfNotExist ¶
func (*Cache) SetIfNotExistFunc ¶
func (*Cache) SetIfNotExistFuncLock ¶
func (*Cache) UpdateExpire ¶
Click to show internal directories.
Click to hide internal directories.