Files
docker-machine/state/state.go
Ankush Agarwal 484f81e1ce Fix doc typo and add additional if condition
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2014-12-28 00:39:57 -08:00

36 lines
451 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
)
var states = []string{
"",
"Running",
"Paused",
"Saved",
"Stopped",
"Stopping",
"Starting",
"Error",
}
// Given a State type, returns its string representation
func (s State) String() string {
if int(s) >= 0 && int(s) < len(states) {
return states[s]
} else {
return ""
}
}