This repository has been archived by the owner on Mar 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #324 from kshlm/elastic-etcd
ElasticEtcd
- Loading branch information
Showing
43 changed files
with
2,026 additions
and
1,160 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 |
---|---|---|
|
@@ -11,3 +11,4 @@ _projects/ | |
# Ignore build and release directories | ||
build/ | ||
releases/ | ||
pkg/elasticetcd/example/example |
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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package peercommands | ||
|
||
// Error is the error type returned by this package | ||
type Error int32 | ||
|
||
// Errors returned by this package | ||
// TODO: Add more errors | ||
const ( | ||
ErrNone Error = iota | ||
ErrAnotherCluster | ||
ErrHaveVolumes | ||
ErrStoreReconfigFailed | ||
ErrUnknownPeer | ||
ErrMax | ||
) | ||
|
||
var errorStrings [ErrMax]string | ||
|
||
func init() { | ||
errorStrings[ErrNone] = "not an error" | ||
errorStrings[ErrAnotherCluster] = "peer is part of another cluster" | ||
errorStrings[ErrHaveVolumes] = "peer has existing volumes" | ||
errorStrings[ErrStoreReconfigFailed] = "store reconfigure failed on peer" | ||
errorStrings[ErrUnknownPeer] = "request recieved from unknown peer" | ||
} | ||
|
||
func (e Error) String() string { | ||
if e <= ErrNone || e >= ErrMax { | ||
return "unknown error" | ||
} | ||
return errorStrings[e] | ||
} | ||
|
||
func (e Error) Error() string { | ||
return e.String() | ||
} |
Oops, something went wrong.