Documentation
¶
Index ¶
- func BloomCmd() *cmdBloom
- func HashCmd() *cmdHash
- func KeyCmd() *cmdKey
- func ListCmd() *cmdList
- func LockWithDeadline(ctx context.Context, key RedisKey, retryDeadline time.Time, retryInterval int, ...) (error, <-chan struct{})
- func LockWithMaxRetry(ctx context.Context, key RedisKey, retryMax, retryInterval int, ...) (error, <-chan struct{})
- func OriginKeyString(keyFormat string, keyAppend ...interface{}) string
- func RawLockerClient() *redislock.Client
- func RawRedisClient() redis.UniversalClient
- func SetCmd() *cmdSet
- func SortedSetCmd() *cmdSortedSet
- func StringCmd() *cmdString
- func TopicCmd() *cmdTopic
- func TryLock(key RedisKey, executable func(), keyAppend ...interface{}) (error, <-chan struct{})
- func TryLockWithContext(ctx context.Context, key RedisKey, executable func(), keyAppend ...interface{}) (error, <-chan struct{})
- type BloomInfo
- type Locker
- type RedisKey
- type RedisStarter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LockWithDeadline ¶
func LockWithDeadline(ctx context.Context, key RedisKey, retryDeadline time.Time, retryInterval int, executable func(), keyAppend ...interface{}) (error, <-chan struct{})
LockWithDeadline 持续尝试获取锁 request lockTtl 获得锁之后的持续时长(超时自动释放)
retryDeadline 重试持续时间 retryInterval 重试间隔(millisecond)
func LockWithMaxRetry ¶
func LockWithMaxRetry(ctx context.Context, key RedisKey, retryMax, retryInterval int, executable func(), keyAppend ...interface{}) (error, <-chan struct{})
LockWithMaxRetry 持续尝试获取锁 request lockTtl 获得锁之后的持续时长(超时自动释放)
retryMax 尝试获取锁最大重试次数 intervalMil 重试间隔(millisecond)
func OriginKeyString ¶
func RawLockerClient ¶
RawLockerClient 获取原始RedisLockerClient进行操作
func RawRedisClient ¶
func RawRedisClient() redis.UniversalClient
RawRedisClient 获取原始RedisClient进行操作
func SortedSetCmd ¶ added in v0.1.4
func SortedSetCmd() *cmdSortedSet
Types ¶
type Locker ¶ added in v0.1.6
type Locker struct {
// contains filtered or unexported fields
}
func TryAndGetLocker ¶ added in v0.1.6
TryAndGetLocker 尝试获取锁并返回Locker
type RedisKey ¶
type RedisStarter ¶
type RedisStarter struct {
RedisConfig redis.UniversalOptions
LazyRedisConfig func() redis.UniversalOptions
InitFunc func(instance redis.UniversalClient)
RedisSetting *parent.Setting
}
func (*RedisStarter) Setting ¶
func (r *RedisStarter) Setting() *parent.Setting
func (*RedisStarter) Start ¶
func (r *RedisStarter) Start() (interface{}, error)
Click to show internal directories.
Click to hide internal directories.