forked from pulcy/kube-lock
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the create, exist functionality to the K8s impl
- Loading branch information
Showing
2 changed files
with
26 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package lock | ||
|
||
import ( | ||
"github.com/juju/errgo" | ||
"errors" | ||
) | ||
|
||
var ( | ||
maskAny = errgo.MaskFunc(errgo.Any) | ||
AlreadyLockedError = errgo.New("already locked") | ||
NotLockedByMeError = errgo.New("not locked by me") | ||
//maskAny = errgo.MaskFunc(errgo.Any) | ||
AlreadyLockedError = errors.New("already locked") | ||
NotLockedByMeError = errors.New("not locked by me") | ||
) | ||
|
||
// IsAlreadyLocked returns true if the given error is caused by a AlreadyLockedError error. | ||
func IsAlreadyLocked(err error) bool { | ||
return errgo.Cause(err) == AlreadyLockedError | ||
} | ||
//func IsAlreadyLocked(err error) bool { | ||
// return errgo.Cause(err) == AlreadyLockedError | ||
//} | ||
|
||
// IsNotLockedByMe returns true if the given error is caused by a NotLockedByMeError error. | ||
func IsNotLockedByMe(err error) bool { | ||
return errgo.Cause(err) == NotLockedByMeError | ||
} | ||
//func IsNotLockedByMe(err error) bool { | ||
// return errgo.Cause(err) == NotLockedByMeError | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters