locking

package
v0.0.0-...-9d61cdf Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 19 Imported by: 4 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoEnvVarsExist

func DoEnvVarsExist(envVars []string) bool

DoEnvVarsExist return true if any of env vars do exist, false otherwise

Types

type Lock

type Lock interface {
	Lock(transactionId int, resource string) (bool, error)
	Unlock(resource string) (bool, error)
	GetLock(resource string) (*int, error)
}

func GetLock

func GetLock() (Lock, error)

type MockLock

type MockLock struct {
	MapLock map[string]int
}

func (*MockLock) GetLock

func (lock *MockLock) GetLock(resource string) (*int, error)

func (*MockLock) Lock

func (lock *MockLock) Lock(transactionId int, resource string) (bool, error)

func (*MockLock) Unlock

func (lock *MockLock) Unlock(resource string) (bool, error)

type NoOpLock

type NoOpLock struct {
}

func (NoOpLock) GetLock

func (noOpLock NoOpLock) GetLock(resource string) (*int, error)

func (NoOpLock) Lock

func (noOpLock NoOpLock) Lock(transactionId int, resource string) (bool, error)

func (NoOpLock) Unlock

func (noOpLock NoOpLock) Unlock(resource string) (bool, error)

type ProjectLock

type ProjectLock interface {
	Lock() (bool, error)
	Unlock() (bool, error)
	ForceUnlock() error
	LockId() string
}

type PullRequestLock

type PullRequestLock struct {
	InternalLock     Lock
	CIService        orchestrator.PullRequestService
	Reporter         reporting.Reporter
	ProjectName      string
	ProjectNamespace string
	PrNumber         int
}

func (*PullRequestLock) ForceUnlock

func (projectLock *PullRequestLock) ForceUnlock() error

func (*PullRequestLock) Lock

func (projectLock *PullRequestLock) Lock() (bool, error)

func (*PullRequestLock) LockId

func (projectLock *PullRequestLock) LockId() string

func (*PullRequestLock) Unlock

func (projectLock *PullRequestLock) Unlock() (bool, error)

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

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