Documentation ¶
Index ¶
- type ConflictingLifecycleActionError
- type IntentionLock
- type IntentionLockUnlocker
- type LifecycleActionManager
- func (a *LifecycleActionManager) AcquireDeploy(system v1.SystemID, deploy v1.DeployID, path tree.Path) error
- func (a *LifecycleActionManager) AcquireTeardown(system v1.SystemID, teardown v1.TeardownID) error
- func (a *LifecycleActionManager) InProgressActions(system v1.SystemID) ([]v1.DeployID, *v1.TeardownID)
- func (a *LifecycleActionManager) ReleaseDeploy(system v1.SystemID, deploy v1.DeployID)
- func (a *LifecycleActionManager) ReleaseTeardown(system v1.SystemID, teardown v1.TeardownID)
- type LockGranularity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConflictingLifecycleActionError ¶
type ConflictingLifecycleActionError struct {
// contains filtered or unexported fields
}
func (*ConflictingLifecycleActionError) Error ¶
func (e *ConflictingLifecycleActionError) Error() string
type IntentionLock ¶
type IntentionLock struct {
// contains filtered or unexported fields
}
IntentionLock is a non-blocking multi-granular lock whose acquisition semantics respect the following matrix:
IX X
IX | Y | N
X | N | N
func (*IntentionLock) TryLock ¶
func (l *IntentionLock) TryLock(granularity LockGranularity) (*IntentionLockUnlocker, bool)
TryLock will attempt to lock the IntentionLock with the supplied LockGranularity without blocking. If it succeeds it returns an IntentionLockUnlocker which must later be used to unlock the lock. If it fails it returns nil.
type IntentionLockUnlocker ¶
type IntentionLockUnlocker struct {
// contains filtered or unexported fields
}
IntentionLockUnlocker is returned by a successful call to TryLock, and is used to later unlock the IntentionLock with the proper granularity.
func (*IntentionLockUnlocker) Granularity ¶
func (u *IntentionLockUnlocker) Granularity() LockGranularity
func (*IntentionLockUnlocker) Unlock ¶
func (u *IntentionLockUnlocker) Unlock()
Unlock will unlock the corresponding IntentionLock for the granularity associated with the IntentionLockUnlocker.
type LifecycleActionManager ¶
type LifecycleActionManager struct { // this could be a RWMutex but trying to keep things "simple" to start sync.Mutex // contains filtered or unexported fields }
func NewLifecycleActionManager ¶
func NewLifecycleActionManager() *LifecycleActionManager
func (*LifecycleActionManager) AcquireDeploy ¶
func (*LifecycleActionManager) AcquireTeardown ¶
func (a *LifecycleActionManager) AcquireTeardown(system v1.SystemID, teardown v1.TeardownID) error
func (*LifecycleActionManager) InProgressActions ¶
func (a *LifecycleActionManager) InProgressActions(system v1.SystemID) ([]v1.DeployID, *v1.TeardownID)
func (*LifecycleActionManager) ReleaseDeploy ¶
func (a *LifecycleActionManager) ReleaseDeploy(system v1.SystemID, deploy v1.DeployID)
func (*LifecycleActionManager) ReleaseTeardown ¶
func (a *LifecycleActionManager) ReleaseTeardown(system v1.SystemID, teardown v1.TeardownID)
type LockGranularity ¶
type LockGranularity int32
LockGranularity defines the granularity with which to obtain a lock.
const ( // LockGranularityIntentionExclusive can be acquired if no // other goroutine has acquired the lock with LockGranularityExclusive. LockGranularityIntentionExclusive LockGranularity = iota // LockGranularityExclusive can be acquired if no other goroutine // has acquired the lock with LockGranularityExclusive or LockGranularityIntentionExclusive. LockGranularityExclusive )