Documentation
¶
Index ¶
- func BloomCmd() *cmdBloom
- func HashCmd() *cmdHash
- func KeyCmd() *cmdKey
- func LockWithDeadline(ctx context.Context, key string, lockTtl time.Duration, ...) error
- func LockWithMaxRetry(ctx context.Context, key string, lockTtl time.Duration, ...) error
- func OriginKeyString(keyFormat string, keyAppend ...interface{}) string
- func QueueCmd() *cmdQueue
- func RawLockerClient() *redislock.Client
- func RawRedisClient() redis.UniversalClient
- func SetCmd() *cmdSet
- func StringCmd() *cmdString
- func TopicCmd() *cmdTopic
- func TryLock(key string, lockTtl time.Duration, executable func()) error
- func TryLockWithContext(ctx context.Context, key string, lockTtl time.Duration, executable func()) error
- type BloomInfo
- type RedisKey
- type RedisStarter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LockWithDeadline ¶
func LockWithDeadline(ctx context.Context, key string, lockTtl time.Duration, retryDeadline time.Time, retryInterval int, executable func()) error
LockWithDeadline 持续尝试获取锁 request lockTtl 获得锁之后的持续时长(超时自动释放)
retryDeadline 重试持续时间 retryInterval 重试间隔(millisecond)
func LockWithMaxRetry ¶
func LockWithMaxRetry(ctx context.Context, key string, lockTtl time.Duration, retryMax, retryInterval int, executable func()) error
LockWithMaxRetry 持续尝试获取锁 request lockTtl 获得锁之后的持续时长(超时自动释放)
retryMax 尝试获取锁最大重试次数 intervalMil 重试间隔(millisecond)
func OriginKeyString ¶
func RawLockerClient ¶
RawLockerClient 获取原始RedisLockerClient进行操作
func RawRedisClient ¶
func RawRedisClient() redis.UniversalClient
RawRedisClient 获取原始RedisClient进行操作
Types ¶
type RedisStarter ¶
type RedisStarter struct {
RedisConfig redis.UniversalOptions
LazyRedisConfig func() redis.UniversalOptions
RedisSetting *parent.Setting
InitFunc func(instance redis.UniversalClient)
}
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.