Documentation ¶
Index ¶
- func SetLogger(logger Logging)
- type Client
- func (c *Client) Append(ctx context.Context, key, value string) *redis.IntCmd
- func (c *Client) BLMove(ctx context.Context, source, destination, srcpos, destpos string, ...) *redis.StringCmd
- func (c *Client) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *redis.StringSliceCmd
- func (c *Client) BRPop(ctx context.Context, timeout time.Duration, keys ...string) *redis.StringSliceCmd
- func (c *Client) BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *redis.StringCmd
- func (c *Client) BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) *redis.ZWithKeyCmd
- func (c *Client) BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) *redis.ZWithKeyCmd
- func (c *Client) BitCount(ctx context.Context, key string, bitCount *redis.BitCount) *redis.IntCmd
- func (c *Client) BitField(ctx context.Context, key string, args ...interface{}) *redis.IntSliceCmd
- func (c *Client) BitOpAnd(ctx context.Context, destKey string, keys ...string) *redis.IntCmd
- func (c *Client) BitOpNot(ctx context.Context, destKey string, key string) *redis.IntCmd
- func (c *Client) BitOpOr(ctx context.Context, destKey string, keys ...string) *redis.IntCmd
- func (c *Client) BitOpXor(ctx context.Context, destKey string, keys ...string) *redis.IntCmd
- func (c *Client) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *redis.IntCmd
- func (c *Client) Copy(ctx context.Context, sourceKey string, destKey string, db int, replace bool) *redis.IntCmd
- func (c *Client) Decr(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) DecrBy(ctx context.Context, key string, decrement int64) *redis.IntCmd
- func (c *Client) Del(ctx context.Context, keys ...string) *redis.IntCmd
- func (c *Client) DisableKeyPrefix()
- func (c *Client) Dump(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) EnableKeyPrefix()
- func (c *Client) Exists(ctx context.Context, keys ...string) *redis.IntCmd
- func (c *Client) Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (c *Client) ExpireAt(ctx context.Context, key string, tm time.Time) *redis.BoolCmd
- func (c *Client) ExpireGT(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (c *Client) ExpireLT(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (c *Client) ExpireNX(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (c *Client) ExpireXX(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (c *Client) GeoAdd(ctx context.Context, key string, geoLocation ...*redis.GeoLocation) *redis.IntCmd
- func (c *Client) GeoDist(ctx context.Context, key string, member1, member2, unit string) *redis.FloatCmd
- func (c *Client) GeoHash(ctx context.Context, key string, members ...string) *redis.StringSliceCmd
- func (c *Client) GeoPos(ctx context.Context, key string, members ...string) *redis.GeoPosCmd
- func (c *Client) GeoRadius(ctx context.Context, key string, longitude, latitude float64, ...) *redis.GeoLocationCmd
- func (c *Client) GeoRadiusByMember(ctx context.Context, key, member string, query *redis.GeoRadiusQuery) *redis.GeoLocationCmd
- func (c *Client) GeoRadiusByMemberStore(ctx context.Context, key, member string, query *redis.GeoRadiusQuery) *redis.IntCmd
- func (c *Client) GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *redis.IntCmd
- func (c *Client) GeoSearch(ctx context.Context, key string, q *redis.GeoSearchQuery) *redis.StringSliceCmd
- func (c *Client) GeoSearchLocation(ctx context.Context, key string, q *redis.GeoSearchLocationQuery) *redis.GeoSearchLocationCmd
- func (c *Client) GeoSearchStore(ctx context.Context, key, store string, q *redis.GeoSearchStoreQuery) *redis.IntCmd
- func (c *Client) Get(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) GetBit(ctx context.Context, key string, offset int64) *redis.IntCmd
- func (c *Client) GetDel(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) GetEx(ctx context.Context, key string, expiration time.Duration) *redis.StringCmd
- func (c *Client) GetRange(ctx context.Context, key string, start, end int64) *redis.StringCmd
- func (c *Client) GetSet(ctx context.Context, key string, value interface{}) *redis.StringCmd
- func (c *Client) HDel(ctx context.Context, key string, fields ...string) *redis.IntCmd
- func (c *Client) HExists(ctx context.Context, key, field string) *redis.BoolCmd
- func (c *Client) HGet(ctx context.Context, key, field string) *redis.StringCmd
- func (c *Client) HGetAll(ctx context.Context, key string) *redis.MapStringStringCmd
- func (c *Client) HIncrBy(ctx context.Context, key, field string, incr int64) *redis.IntCmd
- func (c *Client) HIncrByFloat(ctx context.Context, key, field string, incr float64) *redis.FloatCmd
- func (c *Client) HKeys(ctx context.Context, key string) *redis.StringSliceCmd
- func (c *Client) HLen(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) HMGet(ctx context.Context, key string, fields ...string) *redis.SliceCmd
- func (c *Client) HMSet(ctx context.Context, key string, values ...interface{}) *redis.BoolCmd
- func (c *Client) HRandField(ctx context.Context, key string, count int) *redis.StringSliceCmd
- func (c *Client) HRandFieldWithValues(ctx context.Context, key string, count int) *redis.KeyValueSliceCmd
- func (c *Client) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd
- func (c *Client) HSet(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
- func (c *Client) HSetNX(ctx context.Context, key, field string, value interface{}) *redis.BoolCmd
- func (c *Client) HVals(ctx context.Context, key string) *redis.StringSliceCmd
- func (c *Client) Incr(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) IncrBy(ctx context.Context, key string, value int64) *redis.IntCmd
- func (c *Client) IncrByFloat(ctx context.Context, key string, value float64) *redis.FloatCmd
- func (c *Client) IsEnableKeyPrefix() bool
- func (c *Client) KeyPrefix() string
- func (c *Client) LIndex(ctx context.Context, key string, index int64) *redis.StringCmd
- func (c *Client) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *redis.IntCmd
- func (c *Client) LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *redis.IntCmd
- func (c *Client) LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *redis.IntCmd
- func (c *Client) LLen(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) LMove(ctx context.Context, source, destination, srcpos, destpos string) *redis.StringCmd
- func (c *Client) LPop(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) LPopCount(ctx context.Context, key string, count int) *redis.StringSliceCmd
- func (c *Client) LPos(ctx context.Context, key string, value string, args redis.LPosArgs) *redis.IntCmd
- func (c *Client) LPosCount(ctx context.Context, key string, value string, count int64, ...) *redis.IntSliceCmd
- func (c *Client) LPush(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
- func (c *Client) LPushX(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
- func (c *Client) LRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd
- func (c *Client) LRem(ctx context.Context, key string, count int64, value interface{}) *redis.IntCmd
- func (c *Client) LSet(ctx context.Context, key string, index int64, value interface{}) *redis.StatusCmd
- func (c *Client) LTrim(ctx context.Context, key string, start, stop int64) *redis.StatusCmd
- func (c *Client) MGet(ctx context.Context, keys ...string) *redis.SliceCmd
- func (c *Client) MSet(ctx context.Context, values ...interface{}) *redis.StatusCmd
- func (c *Client) MSetNX(ctx context.Context, values ...interface{}) *redis.BoolCmd
- func (c *Client) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *redis.StatusCmd
- func (c *Client) Move(ctx context.Context, key string, db int) *redis.BoolCmd
- func (c *Client) ObjectEncoding(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) ObjectIdleTime(ctx context.Context, key string) *redis.DurationCmd
- func (c *Client) ObjectRefCount(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) PExpire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (c *Client) PExpireAt(ctx context.Context, key string, tm time.Time) *redis.BoolCmd
- func (c *Client) PFAdd(ctx context.Context, key string, els ...interface{}) *redis.IntCmd
- func (c *Client) PFCount(ctx context.Context, keys ...string) *redis.IntCmd
- func (c *Client) PFMerge(ctx context.Context, dest string, keys ...string) *redis.StatusCmd
- func (c *Client) PTTL(ctx context.Context, key string) *redis.DurationCmd
- func (c *Client) Persist(ctx context.Context, key string) *redis.BoolCmd
- func (c *Client) RPop(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) RPopCount(ctx context.Context, key string, count int) *redis.StringSliceCmd
- func (c *Client) RPopLPush(ctx context.Context, source, destination string) *redis.StringCmd
- func (c *Client) RPush(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
- func (c *Client) RPushX(ctx context.Context, key string, values ...interface{}) *redis.IntCmd
- func (c *Client) Rename(ctx context.Context, key, newkey string) *redis.StatusCmd
- func (c *Client) RenameNX(ctx context.Context, key, newkey string) *redis.BoolCmd
- func (c *Client) Restore(ctx context.Context, key string, ttl time.Duration, value string) *redis.StatusCmd
- func (c *Client) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *redis.StatusCmd
- func (c *Client) SAdd(ctx context.Context, key string, members ...interface{}) *redis.IntCmd
- func (c *Client) SCard(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) SDiff(ctx context.Context, keys ...string) *redis.StringSliceCmd
- func (c *Client) SDiffStore(ctx context.Context, destination string, keys ...string) *redis.IntCmd
- func (c *Client) SInter(ctx context.Context, keys ...string) *redis.StringSliceCmd
- func (c *Client) SInterCard(ctx context.Context, limit int64, keys ...string) *redis.IntCmd
- func (c *Client) SInterStore(ctx context.Context, destination string, keys ...string) *redis.IntCmd
- func (c *Client) SIsMember(ctx context.Context, key string, member interface{}) *redis.BoolCmd
- func (c *Client) SMIsMember(ctx context.Context, key string, members ...interface{}) *redis.BoolSliceCmd
- func (c *Client) SMembers(ctx context.Context, key string) *redis.StringSliceCmd
- func (c *Client) SMembersMap(ctx context.Context, key string) *redis.StringStructMapCmd
- func (c *Client) SMove(ctx context.Context, source, destination string, member interface{}) *redis.BoolCmd
- func (c *Client) SPop(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) SPopN(ctx context.Context, key string, count int64) *redis.StringSliceCmd
- func (c *Client) SRandMember(ctx context.Context, key string) *redis.StringCmd
- func (c *Client) SRandMemberN(ctx context.Context, key string, count int64) *redis.StringSliceCmd
- func (c *Client) SRem(ctx context.Context, key string, members ...interface{}) *redis.IntCmd
- func (c *Client) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd
- func (c *Client) SUnion(ctx context.Context, keys ...string) *redis.StringSliceCmd
- func (c *Client) SUnionStore(ctx context.Context, destination string, keys ...string) *redis.IntCmd
- func (c *Client) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
- func (c *Client) SetArgs(ctx context.Context, key string, value interface{}, a redis.SetArgs) *redis.StatusCmd
- func (c *Client) SetBit(ctx context.Context, key string, offset int64, value int) *redis.IntCmd
- func (c *Client) SetEx(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
- func (c *Client) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd
- func (c *Client) SetRange(ctx context.Context, key string, offset int64, value string) *redis.IntCmd
- func (c *Client) SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.BoolCmd
- func (c *Client) Sort(ctx context.Context, key string, sort *redis.Sort) *redis.StringSliceCmd
- func (c *Client) SortInterfaces(ctx context.Context, key string, sort *redis.Sort) *redis.SliceCmd
- func (c *Client) SortRO(ctx context.Context, key string, sort *redis.Sort) *redis.StringSliceCmd
- func (c *Client) SortStore(ctx context.Context, key, store string, sort *redis.Sort) *redis.IntCmd
- func (c *Client) StrLen(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) TTL(ctx context.Context, key string) *redis.DurationCmd
- func (c *Client) Touch(ctx context.Context, keys ...string) *redis.IntCmd
- func (c *Client) Type(ctx context.Context, key string) *redis.StatusCmd
- func (c *Client) Unlink(ctx context.Context, keys ...string) *redis.IntCmd
- func (c *Client) ZAdd(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd
- func (c *Client) ZAddArgs(ctx context.Context, key string, args redis.ZAddArgs) *redis.IntCmd
- func (c *Client) ZAddArgsIncr(ctx context.Context, key string, args redis.ZAddArgs) *redis.FloatCmd
- func (c *Client) ZAddNX(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd
- func (c *Client) ZAddXX(ctx context.Context, key string, members ...redis.Z) *redis.IntCmd
- func (c *Client) ZCard(ctx context.Context, key string) *redis.IntCmd
- func (c *Client) ZCount(ctx context.Context, key, min, max string) *redis.IntCmd
- func (c *Client) ZDiff(ctx context.Context, keys ...string) *redis.StringSliceCmd
- func (c *Client) ZDiffStore(ctx context.Context, destination string, keys ...string) *redis.IntCmd
- func (c *Client) ZDiffWithScores(ctx context.Context, keys ...string) *redis.ZSliceCmd
- func (c *Client) ZIncrBy(ctx context.Context, key string, increment float64, member string) *redis.FloatCmd
- func (c *Client) ZInter(ctx context.Context, store *redis.ZStore) *redis.StringSliceCmd
- func (c *Client) ZInterCard(ctx context.Context, limit int64, keys ...string) *redis.IntCmd
- func (c *Client) ZInterStore(ctx context.Context, destination string, store *redis.ZStore) *redis.IntCmd
- func (c *Client) ZInterWithScores(ctx context.Context, store *redis.ZStore) *redis.ZSliceCmd
- func (c *Client) ZLexCount(ctx context.Context, key, min, max string) *redis.IntCmd
- func (c *Client) ZMScore(ctx context.Context, key string, members ...string) *redis.FloatSliceCmd
- func (c *Client) ZPopMax(ctx context.Context, key string, count ...int64) *redis.ZSliceCmd
- func (c *Client) ZPopMin(ctx context.Context, key string, count ...int64) *redis.ZSliceCmd
- func (c *Client) ZRandMember(ctx context.Context, key string, count int) *redis.StringSliceCmd
- func (c *Client) ZRandMemberWithScores(ctx context.Context, key string, count int) *redis.ZSliceCmd
- func (c *Client) ZRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd
- func (c *Client) ZRangeArgs(ctx context.Context, z redis.ZRangeArgs) *redis.StringSliceCmd
- func (c *Client) ZRangeArgsWithScores(ctx context.Context, z redis.ZRangeArgs) *redis.ZSliceCmd
- func (c *Client) ZRangeByLex(ctx context.Context, key string, opt *redis.ZRangeBy) *redis.StringSliceCmd
- func (c *Client) ZRangeByScore(ctx context.Context, key string, opt *redis.ZRangeBy) *redis.StringSliceCmd
- func (c *Client) ZRangeByScoreWithScores(ctx context.Context, key string, opt *redis.ZRangeBy) *redis.ZSliceCmd
- func (c *Client) ZRangeStore(ctx context.Context, dst string, z redis.ZRangeArgs) *redis.IntCmd
- func (c *Client) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *redis.ZSliceCmd
- func (c *Client) ZRank(ctx context.Context, key, member string) *redis.IntCmd
- func (c *Client) ZRem(ctx context.Context, key string, members ...interface{}) *redis.IntCmd
- func (c *Client) ZRemRangeByLex(ctx context.Context, key, min, max string) *redis.IntCmd
- func (c *Client) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *redis.IntCmd
- func (c *Client) ZRemRangeByScore(ctx context.Context, key, min, max string) *redis.IntCmd
- func (c *Client) ZRevRange(ctx context.Context, key string, start, stop int64) *redis.StringSliceCmd
- func (c *Client) ZRevRangeByLex(ctx context.Context, key string, opt *redis.ZRangeBy) *redis.StringSliceCmd
- func (c *Client) ZRevRangeByScore(ctx context.Context, key string, opt *redis.ZRangeBy) *redis.StringSliceCmd
- func (c *Client) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *redis.ZRangeBy) *redis.ZSliceCmd
- func (c *Client) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *redis.ZSliceCmd
- func (c *Client) ZRevRank(ctx context.Context, key, member string) *redis.IntCmd
- func (c *Client) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd
- func (c *Client) ZScore(ctx context.Context, key, member string) *redis.FloatCmd
- func (c *Client) ZUnion(ctx context.Context, store redis.ZStore) *redis.StringSliceCmd
- func (c *Client) ZUnionStore(ctx context.Context, dest string, store *redis.ZStore) *redis.IntCmd
- func (c *Client) ZUnionWithScores(ctx context.Context, store redis.ZStore) *redis.ZSliceCmd
- type Logging
- type RedisConfig
- type RedisCounter
- type RedisLocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v1.20.6
type Client struct { *redis.Client // contains filtered or unexported fields }
Client 支持key前缀的Redis单点客户端 关于key前缀,X开头的方法不支持
- 示例:
- client,_ := xredis.NewClient(cfg)
- client.Set(ctx, key, '1', 0) // 支持key前缀
- client.XAdd() // 不支持key前缀
- client.Do(ctx, "set", "key", "value") // 不支持key前缀
- client.Client.Set() // 不支持key前缀
func NewClient ¶
func NewClient(config *RedisConfig) (client *Client, err error)
func (*Client) BRPopLPush ¶ added in v1.21.6
func (*Client) DisableKeyPrefix ¶ added in v1.20.8
func (c *Client) DisableKeyPrefix()
func (*Client) EnableKeyPrefix ¶ added in v1.20.8
func (c *Client) EnableKeyPrefix()
func (*Client) GeoRadiusByMember ¶ added in v1.21.6
func (*Client) GeoRadiusByMemberStore ¶ added in v1.21.6
func (*Client) GeoRadiusStore ¶ added in v1.21.6
func (*Client) GeoSearchLocation ¶ added in v1.21.6
func (*Client) GeoSearchStore ¶ added in v1.21.6
func (*Client) HIncrByFloat ¶ added in v1.21.6
func (*Client) HRandField ¶ added in v1.21.6
func (*Client) HRandFieldWithValues ¶ added in v1.21.6
func (*Client) IncrByFloat ¶ added in v1.21.6
func (*Client) IsEnableKeyPrefix ¶ added in v1.21.6
func (*Client) LInsertAfter ¶ added in v1.21.6
func (*Client) LInsertBefore ¶ added in v1.21.6
func (*Client) ObjectEncoding ¶ added in v1.21.6
func (*Client) ObjectIdleTime ¶ added in v1.21.6
func (*Client) ObjectRefCount ¶ added in v1.21.6
func (*Client) RestoreReplace ¶ added in v1.21.6
func (*Client) SDiffStore ¶ added in v1.21.6
func (*Client) SInterCard ¶ added in v1.21.6
func (*Client) SInterStore ¶ added in v1.21.6
func (*Client) SMIsMember ¶ added in v1.21.6
func (*Client) SMembersMap ¶ added in v1.21.6
func (*Client) SRandMember ¶ added in v1.21.6
func (*Client) SRandMemberN ¶ added in v1.21.6
func (*Client) SUnionStore ¶ added in v1.21.6
func (*Client) SortInterfaces ¶ added in v1.21.6
func (*Client) ZAddArgsIncr ¶ added in v1.21.6
func (*Client) ZDiffStore ¶ added in v1.21.6
func (*Client) ZDiffWithScores ¶ added in v1.21.6
func (*Client) ZInterCard ¶ added in v1.21.6
func (*Client) ZInterStore ¶ added in v1.21.6
func (*Client) ZInterWithScores ¶ added in v1.21.6
func (*Client) ZRandMember ¶ added in v1.21.6
func (*Client) ZRandMemberWithScores ¶ added in v1.21.6
func (*Client) ZRangeArgs ¶ added in v1.21.6
func (*Client) ZRangeArgsWithScores ¶ added in v1.21.6
func (*Client) ZRangeByLex ¶ added in v1.21.6
func (*Client) ZRangeByScore ¶ added in v1.21.6
func (*Client) ZRangeByScoreWithScores ¶ added in v1.21.6
func (*Client) ZRangeStore ¶ added in v1.21.6
func (*Client) ZRangeWithScores ¶ added in v1.21.6
func (*Client) ZRemRangeByLex ¶ added in v1.21.6
func (*Client) ZRemRangeByRank ¶ added in v1.21.6
func (*Client) ZRemRangeByScore ¶ added in v1.21.6
func (*Client) ZRevRangeByLex ¶ added in v1.21.6
func (*Client) ZRevRangeByScore ¶ added in v1.21.6
func (*Client) ZRevRangeByScoreWithScores ¶ added in v1.21.6
func (*Client) ZRevRangeWithScores ¶ added in v1.21.6
func (*Client) ZUnionStore ¶ added in v1.21.6
func (*Client) ZUnionWithScores ¶ added in v1.21.6
type RedisConfig ¶
type RedisConfig struct { Addr string `json:"addr"` Password string `json:"password"` DB int `json:"DB"` DialTimeout int64 `json:"dialTimeout"` ReadTimeout int64 `json:"readTimeout"` WriteTimeout int64 `json:"writeTimeout"` IdleTimeout int64 `json:"idleTimeout"` // 连接生效时间,默认5分钟 MaxRetries int `json:"maxRetries"` PoolSize int `json:"poolSize"` MinIdleConn int `json:"minIdleConn"` KeyPrefix string `json:"keyPrefix"` }
type RedisCounter ¶
type RedisCounter struct {
// contains filtered or unexported fields
}
RedisCounter Redis 计数器
func NewRedisCounter ¶
func NewRedisCounter(client *Client, key string, keyFmtArgs ...interface{}) *RedisCounter
type RedisLocker ¶
type RedisLocker struct {
// contains filtered or unexported fields
}
RedisLocker Redis 锁
func NewRedisLocker ¶
func NewRedisLocker(client *Client, key string, keyFmtArgs ...interface{}) *RedisLocker
func (*RedisLocker) Key ¶
func (l *RedisLocker) Key() string
func (*RedisLocker) Lock ¶
func (l *RedisLocker) Lock(ctx context.Context, values ...interface{}) bool
func (*RedisLocker) Unlock ¶
func (l *RedisLocker) Unlock(ctx context.Context, values ...interface{}) bool
func (*RedisLocker) WithConfig ¶
func (l *RedisLocker) WithConfig(retries int, interval, expiration time.Duration) *RedisLocker
Click to show internal directories.
Click to hide internal directories.