Files
docker-machine/libmachine/state/state.go
Olivier Gambier 19fc49b58a Lint, step 1
The easy stuff

Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-11-04 14:17:58 -08:00

37 lines
461 B
Go

package state
// State represents the state of a host
type State int
const (
None State = iota
Running
Paused
Saved
Stopped
Stopping
Starting
Error
Timeout
)
var states = []string{
"",
"Running",
"Paused",
"Saved",
"Stopped",
"Stopping",
"Starting",
"Error",
"Timeout",
}
// Given a State type, returns its string representation
func (s State) String() string {
if int(s) >= 0 && int(s) < len(states) {
return states[s]
}
return ""
}