mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-11 14:54:23 -05:00
52 lines
1.5 KiB
Go
52 lines
1.5 KiB
Go
|
|
// Code generated by "enumer -type=childProcessState -trimprefix=childProcessState"; DO NOT EDIT.
|
||
|
|
|
||
|
|
package exec
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
)
|
||
|
|
|
||
|
|
const _childProcessStateName = "NotStartedRunningRestartingStopped"
|
||
|
|
|
||
|
|
var _childProcessStateIndex = [...]uint8{0, 10, 17, 27, 34}
|
||
|
|
|
||
|
|
func (i childProcessState) String() string {
|
||
|
|
if i >= childProcessState(len(_childProcessStateIndex)-1) {
|
||
|
|
return fmt.Sprintf("childProcessState(%d)", i)
|
||
|
|
}
|
||
|
|
return _childProcessStateName[_childProcessStateIndex[i]:_childProcessStateIndex[i+1]]
|
||
|
|
}
|
||
|
|
|
||
|
|
var _childProcessStateValues = []childProcessState{0, 1, 2, 3}
|
||
|
|
|
||
|
|
var _childProcessStateNameToValueMap = map[string]childProcessState{
|
||
|
|
_childProcessStateName[0:10]: 0,
|
||
|
|
_childProcessStateName[10:17]: 1,
|
||
|
|
_childProcessStateName[17:27]: 2,
|
||
|
|
_childProcessStateName[27:34]: 3,
|
||
|
|
}
|
||
|
|
|
||
|
|
// childProcessStateString retrieves an enum value from the enum constants string name.
|
||
|
|
// Throws an error if the param is not part of the enum.
|
||
|
|
func childProcessStateString(s string) (childProcessState, error) {
|
||
|
|
if val, ok := _childProcessStateNameToValueMap[s]; ok {
|
||
|
|
return val, nil
|
||
|
|
}
|
||
|
|
return 0, fmt.Errorf("%s does not belong to childProcessState values", s)
|
||
|
|
}
|
||
|
|
|
||
|
|
// childProcessStateValues returns all values of the enum
|
||
|
|
func childProcessStateValues() []childProcessState {
|
||
|
|
return _childProcessStateValues
|
||
|
|
}
|
||
|
|
|
||
|
|
// IsAchildProcessState returns "true" if the value is listed in the enum definition. "false" otherwise
|
||
|
|
func (i childProcessState) IsAchildProcessState() bool {
|
||
|
|
for _, v := range _childProcessStateValues {
|
||
|
|
if i == v {
|
||
|
|
return true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return false
|
||
|
|
}
|