Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrAlreadyLocked ¶
type ErrAlreadyLocked struct{}
func (*ErrAlreadyLocked) Error ¶
func (e *ErrAlreadyLocked) Error() string
type EtcdLocker ¶
type EtcdLocker struct {
// contains filtered or unexported fields
}
func (*EtcdLocker) WaitAcquire ¶
type EtcdLockerOpt ¶
type EtcdLockerOpt func(locker *EtcdLocker)
func WithCooldownTryLockDuration ¶
func WithCooldownTryLockDuration(timeout time.Duration) EtcdLockerOpt
func WithMaxTryLockTimeout ¶
func WithMaxTryLockTimeout(timeout time.Duration) EtcdLockerOpt
func WithTryLockTimeout ¶
func WithTryLockTimeout(timeout time.Duration) EtcdLockerOpt
type Locker ¶
type Locker interface { Acquire(ctx context.Context, key string, ttl int) (Lock, error) WaitAcquire(ctx context.Context, key string, ttl int) (Lock, error) Wait(ctx context.Context, key string) error }
func NewEtcdLocker ¶
func NewEtcdLocker(client *etcd.Client, opts ...EtcdLockerOpt) Locker
Click to show internal directories.
Click to hide internal directories.