Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) Lock(ctx context.Context, key string, expiration, timeout time.Duration, ...) (*Lock, error)
- func (c *Client) SingleFlightLock(ctx context.Context, key string, expiration, timeout time.Duration, ...) (*Lock, error)
- func (c *Client) TryLock(ctx context.Context, key string, expiration time.Duration) (*Lock, error)
- type ClientV2
- type FixedIntervalRetryStrategy
- type Lock
- type RetryStrategy
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFailedToPreemptLock = errors.New("redis-lock: 抢锁失败")
)
View Source
var (
ErrLockNotHold = errors.New("redis-lock: 你没有持有锁")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type FixedIntervalRetryStrategy ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
func (*Lock) AutoRefresh ¶
type RetryStrategy ¶
Click to show internal directories.
Click to hide internal directories.