Documentation
¶
Index ¶
- func NewRedis(redis *gredis.Redis) gcache.Adapter
- type Redis
- func (c Redis) Clear(ctx context.Context) error
- func (c Redis) Close(ctx context.Context) error
- func (c Redis) Contains(ctx context.Context, key interface{}) (bool, error)
- func (c Redis) Data(ctx context.Context) (map[interface{}]interface{}, error)
- func (c Redis) Get(ctx context.Context, key interface{}) (*gvar.Var, error)
- func (c Redis) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)
- func (c Redis) GetOrSet(ctx context.Context, key interface{}, value interface{}, ...) (*gvar.Var, error)
- func (c Redis) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (*gvar.Var, error)
- func (c Redis) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (c Redis) Keys(ctx context.Context) ([]interface{}, error)
- func (c Redis) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)
- func (c Redis) Set(ctx context.Context, key interface{}, value interface{}, ...) error
- func (c Redis) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, ...) (bool, error)
- func (c Redis) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (bool, error)
- func (c Redis) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (c Redis) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error
- func (c Redis) Size(ctx context.Context) (int, error)
- func (c Redis) Update(ctx context.Context, key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)
- func (c Redis) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)
- func (c Redis) Values(ctx context.Context) ([]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis is the gcache adapter implements using Redis server.
func (Redis) GetOrSetFunc ¶
func (Redis) GetOrSetFuncLock ¶
func (Redis) SetIfNotExist ¶
func (Redis) SetIfNotExistFunc ¶
func (Redis) SetIfNotExistFuncLock ¶
func (Redis) UpdateExpire ¶
Click to show internal directories.
Click to hide internal directories.