Versions in this module Expand all Collapse all v0 v0.1.1 Mar 11, 2023 Changes in this version + type RedisClient interface + Del func(ctx context.Context, key ...string) *redis.IntCmd + Eval func(ctx context.Context, script string, keys []string, args ...interface{}) *redis.Cmd + Expire func(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd + SetNX func(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd + type RedisLock struct + Client RedisClient + Key string + func NewRedisLock(client RedisClient, key string) (*RedisLock, error) + func (rl *RedisLock) SpinLock(ctx context.Context, retryTimes int) (bool, error) + func (rl *RedisLock) TryLock(ctx context.Context) (bool, error) + func (rl *RedisLock) Unlock(ctx context.Context) (bool, error) + type RedisTools struct + Client RedisClient + func NewTools(client RedisClient) *RedisTools + func (r *RedisTools) Cad(ctx context.Context, key string, value interface{}) (bool, error) + func (r *RedisTools) Cas(ctx context.Context, key string, oldValue interface{}, newValue interface{}) (bool, error) + func (r *RedisTools) CasEx(ctx context.Context, key string, oldValue interface{}, newValue interface{}, ...) (bool, error)