lock

package
v3.4.1-wings+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LockTypeResourceConfigChecking = iota
	LockTypeBuildTracking
	LockTypePipelineScheduling
	LockTypeBatch
	LockTypeVolumeCreating
	LockTypeContainerCreating
)

Variables

View Source
var ErrLostLock = errors.New("lock was lost while held, possibly due to connection breakage")

Functions

This section is empty.

Types

type Lock

type Lock interface {
	Release() error
}

type LockDB

type LockDB interface {
	Acquire(id LockID) (bool, error)
	Release(id LockID) (bool, error)
}

type LockFactory

type LockFactory interface {
	Acquire(logger lager.Logger, ids LockID) (Lock, bool, error)
}

func NewLockFactory

func NewLockFactory(conn *sql.DB) LockFactory

func NewTestLockFactory

func NewTestLockFactory(db LockDB) LockFactory

type LockID

type LockID []int

func NewBuildTrackingLockID

func NewBuildTrackingLockID(buildID int) LockID

func NewContainerCreatingLockID

func NewContainerCreatingLockID(containerID int) LockID

func NewPipelineSchedulingLockLockID

func NewPipelineSchedulingLockLockID(pipelineID int) LockID

func NewResourceConfigCheckingLockID

func NewResourceConfigCheckingLockID(resourceConfigID int) LockID

func NewTaskLockID

func NewTaskLockID(taskName string) LockID

func NewVolumeCreatingLockID

func NewVolumeCreatingLockID(volumeID int) LockID

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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