lock

package
v3.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2019 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct{}

func (*Error) Error

func (e *Error) Error() string

type EtcdLock

type EtcdLock struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func (*EtcdLock) Release

func (l *EtcdLock) Release() error

type EtcdLocker

type EtcdLocker struct {
	// contains filtered or unexported fields
}

func (*EtcdLocker) Acquire

func (locker *EtcdLocker) Acquire(key string, ttl int) (Lock, error)

func (*EtcdLocker) Wait

func (locker *EtcdLocker) Wait(key string) error

func (*EtcdLocker) WaitAcquire

func (locker *EtcdLocker) WaitAcquire(key string, ttl int) (Lock, error)

type EtcdLockerOpt added in v3.4.1

type EtcdLockerOpt func(locker *EtcdLocker)

func WithTrylockTimeout added in v3.4.1

func WithTrylockTimeout(timeout time.Duration) EtcdLockerOpt

type Lock

type Lock interface {
	Release() error
}

type Locker

type Locker interface {
	Acquire(key string, ttl int) (Lock, error)
	WaitAcquire(key string, ttl int) (Lock, error)
	Wait(key string) error
}

func NewEtcdLocker

func NewEtcdLocker(client *etcd.Client, opts ...EtcdLockerOpt) Locker

Directories

Path Synopsis
Package lockmock is a generated GoMock package.
Package lockmock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL