lock

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: BSD-2-Clause Imports: 9 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 {
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

type EtcdLock

type EtcdLock struct {
	// 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 uint64) (Lock, error)

func (*EtcdLocker) Wait

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

func (*EtcdLocker) WaitAcquire

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

type Lock

type Lock interface {
	Release() error
}

type Locker

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

func NewEtcdLocker

func NewEtcdLocker(client etcd.Client) Locker

type MockLock

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

func (*MockLock) Release

func (lock *MockLock) Release() error

type MockLocker

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

func NewMockLocker

func NewMockLocker() *MockLocker

func (*MockLocker) Acquire

func (locker *MockLocker) Acquire(path string, ttl uint64) (Lock, error)

func (*MockLocker) Wait

func (locker *MockLocker) Wait(path string) error

func (*MockLocker) WaitAcquire

func (locker *MockLocker) WaitAcquire(path string, ttl uint64) (Lock, error)

Jump to

Keyboard shortcuts

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