Documentation
¶
Index ¶
- func GoRedisEvalFunc(ctx context.Context, script string, keys []string, args ...interface{}) (ret int, err error)
- func InitRedis(ctx context.Context, opts *redis.ClusterOptions)
- func SetRedis(ctx context.Context, r redis.Cmdable)
- type EvalFunc
- type Locker
- type LogFunc
- type NewContextFunc
- type RedisLocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoRedisEvalFunc ¶
func GoRedisEvalFunc(ctx context.Context, script string, keys []string, args ...interface{}) (ret int, err error)
GoRedisEvalFunc ...eval func warpper for go-redis
Types ¶
type EvalFunc ¶
type EvalFunc func(ctx context.Context, script string, keys []string, values ...interface{}) (ret int, err error)
EvalFunc ...redis eval func
type Locker ¶
type Locker interface { // Lock ... Lock() bool // Refresh ... // Refresh() error // Unlock ... Unlock() bool // GetValue return value of locker, i.e token for unlock GetValue() string }
Locker .....
type NewContextFunc ¶
NewContextFunc ...
type RedisLocker ¶
type RedisLocker struct {
// contains filtered or unexported fields
}
RedisLocker ...
func NewRedisLocker ¶
NewRedisLocker ...
func (*RedisLocker) SetDoEvalFunc ¶
func (r *RedisLocker) SetDoEvalFunc(f EvalFunc)
SetDoEvalFunc 设置eval方法,请自行包装,适配各种redis library
func (*RedisLocker) SetLogErrorFunc ¶
func (r *RedisLocker) SetLogErrorFunc(f LogFunc)
SetLogErrorFunc 设置输出错误日志的方法
Click to show internal directories.
Click to hide internal directories.