mirror of https://github.com/docker/docs.git
30 lines
373 B
Go
30 lines
373 B
Go
package serviceaction
|
|
|
|
type ServiceAction int
|
|
|
|
const (
|
|
Restart ServiceAction = iota
|
|
Start
|
|
Stop
|
|
Enable
|
|
Disable
|
|
DaemonReload
|
|
)
|
|
|
|
var serviceActions = []string{
|
|
"restart",
|
|
"start",
|
|
"stop",
|
|
"enable",
|
|
"disable",
|
|
"daemon-reload",
|
|
}
|
|
|
|
func (s ServiceAction) String() string {
|
|
if int(s) >= 0 && int(s) < len(serviceActions) {
|
|
return serviceActions[s]
|
|
}
|
|
|
|
return ""
|
|
}
|