packer-cn/packer/fixconfigmode_enumer.go

52 lines
1.3 KiB
Go
Raw Permalink Normal View History

2020-05-08 10:54:44 -04:00
// Code generated by "enumer -type FixConfigMode"; DO NOT EDIT.
//
package packer
import (
"fmt"
)
const _FixConfigModeName = "StdoutInplaceDiff"
var _FixConfigModeIndex = [...]uint8{0, 6, 13, 17}
func (i FixConfigMode) String() string {
if i < 0 || i >= FixConfigMode(len(_FixConfigModeIndex)-1) {
return fmt.Sprintf("FixConfigMode(%d)", i)
}
return _FixConfigModeName[_FixConfigModeIndex[i]:_FixConfigModeIndex[i+1]]
}
var _FixConfigModeValues = []FixConfigMode{0, 1, 2}
var _FixConfigModeNameToValueMap = map[string]FixConfigMode{
_FixConfigModeName[0:6]: 0,
_FixConfigModeName[6:13]: 1,
_FixConfigModeName[13:17]: 2,
}
// FixConfigModeString retrieves an enum value from the enum constants string name.
// Throws an error if the param is not part of the enum.
func FixConfigModeString(s string) (FixConfigMode, error) {
if val, ok := _FixConfigModeNameToValueMap[s]; ok {
return val, nil
}
return 0, fmt.Errorf("%s does not belong to FixConfigMode values", s)
}
// FixConfigModeValues returns all values of the enum
func FixConfigModeValues() []FixConfigMode {
return _FixConfigModeValues
}
// IsAFixConfigMode returns "true" if the value is listed in the enum definition. "false" otherwise
func (i FixConfigMode) IsAFixConfigMode() bool {
for _, v := range _FixConfigModeValues {
if i == v {
return true
}
}
return false
}