Documentation
¶
Index ¶
- type RedisClient
- type RedisLock
- type 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient interface {
Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
Del(ctx context.Context, key ...string) *redis.IntCmd
SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd
Eval(ctx context.Context, script string, keys []string, args ...interface{}) *redis.Cmd
}
type RedisLock ¶
type RedisLock struct {
Client RedisClient
Key string
// contains filtered or unexported fields
}
func NewRedisLock ¶
func NewRedisLock(client RedisClient, key string) (*RedisLock, error)
NewRedisLock new a redis distribute lock
type RedisTools ¶
type RedisTools struct {
Client RedisClient
}
func NewTools ¶
func NewTools(client RedisClient) *RedisTools
Click to show internal directories.
Click to hide internal directories.