Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var WithExpire = func(expire time.Duration) optionFunc { return func(locker Locker) { locker.setExpire(expire) } }
View Source
var WithKeyPrefix = func(prefix string) optionFunc { return func(locker Locker) { locker.setKeyPrefix(prefix) } }
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker interface { Lock(ctx context.Context, key string, value string) (bool, error) Unlock(ctx context.Context, key string, value string) (success bool, err error) // contains filtered or unexported methods }
func NewRedisLocker ¶
func NewRedisLocker(client *redis.Client, optionFunc ...optionFunc) Locker
Click to show internal directories.
Click to hide internal directories.