lock

package
v0.0.0-...-d1c0bb1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2016 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLock

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

func NewAppLock

func NewAppLock(locks map[uuid.UUID]string) *AppLock

func (*AppLock) GetAppLocks

func (a *AppLock) GetAppLocks() map[uuid.UUID]string

type LockInternal

type LockInternal struct {
	Mutex   sync.Mutex
	Message []string
}

func NewLockInternal

func NewLockInternal(message string) *LockInternal

func (*LockInternal) AddMessage

func (l *LockInternal) AddMessage(message string)

func (*LockInternal) GetMessages

func (l *LockInternal) GetMessages() (messages []string)

type LockManager

type LockManager interface {
	//The following method will try to acquire provided lock
	AcquireLock(ctxt string, appLock AppLock) error
	// The following method will release a lock
	ReleaseLock(ctxt string, appLock AppLock)
	//The following method will clear all inserted locks
	Clear()
}

type Manager

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

func NewLockManager

func NewLockManager() *Manager

func (*Manager) AcquireLock

func (manager *Manager) AcquireLock(ctxt string, appLock AppLock) error

func (*Manager) Clear

func (manager *Manager) Clear()

func (*Manager) ReleaseLock

func (manager *Manager) ReleaseLock(ctxt string, appLock AppLock)

Jump to

Keyboard shortcuts

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