github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/worker/uniter/operation/lock.go (about) 1 // Copyright 2014-2015 Canonical Ltd. 2 // Copyright 2015 Cloudbase Solutions SRL 3 // Licensed under the AGPLv3, see LICENCE file for details. 4 5 package operation 6 7 // DoesNotRequireMachineLock is embedded in the various operations to express whether 8 // they need a global machine lock or not. 9 type RequiresMachineLock struct{} 10 11 // NeedsGlobalMachineLock is part of the Operation interface. 12 // It is embedded in the various operations. 13 func (RequiresMachineLock) NeedsGlobalMachineLock() bool { return true } 14 15 // DoesNotRequireMachineLock is embedded in the various operations to express whether 16 // they need a global machine lock or not. 17 type DoesNotRequireMachineLock struct{} 18 19 // NeedsGlobalMachineLock is part of the Operation interface. 20 // It is embedded in the various operations. 21 func (DoesNotRequireMachineLock) NeedsGlobalMachineLock() bool { return false }