2020-05-08 16:54:44 +02:00
|
|
|
// Code generated by "enumer -type FixConfigMode"; DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
package packer
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
2024-07-16 21:14:27 -04:00
|
|
|
"strings"
|
2020-05-08 16:54:44 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const _FixConfigModeName = "StdoutInplaceDiff"
|
|
|
|
|
|
|
|
|
|
var _FixConfigModeIndex = [...]uint8{0, 6, 13, 17}
|
|
|
|
|
|
2024-07-16 21:14:27 -04:00
|
|
|
const _FixConfigModeLowerName = "stdoutinplacediff"
|
|
|
|
|
|
2020-05-08 16:54:44 +02:00
|
|
|
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]]
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-16 21:14:27 -04:00
|
|
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
|
|
|
|
// Re-run the stringer command to generate them again.
|
|
|
|
|
func _FixConfigModeNoOp() {
|
|
|
|
|
var x [1]struct{}
|
|
|
|
|
_ = x[Stdout-(0)]
|
|
|
|
|
_ = x[Inplace-(1)]
|
|
|
|
|
_ = x[Diff-(2)]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _FixConfigModeValues = []FixConfigMode{Stdout, Inplace, Diff}
|
2020-05-08 16:54:44 +02:00
|
|
|
|
|
|
|
|
var _FixConfigModeNameToValueMap = map[string]FixConfigMode{
|
2024-07-16 21:14:27 -04:00
|
|
|
_FixConfigModeName[0:6]: Stdout,
|
|
|
|
|
_FixConfigModeLowerName[0:6]: Stdout,
|
|
|
|
|
_FixConfigModeName[6:13]: Inplace,
|
|
|
|
|
_FixConfigModeLowerName[6:13]: Inplace,
|
|
|
|
|
_FixConfigModeName[13:17]: Diff,
|
|
|
|
|
_FixConfigModeLowerName[13:17]: Diff,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var _FixConfigModeNames = []string{
|
|
|
|
|
_FixConfigModeName[0:6],
|
|
|
|
|
_FixConfigModeName[6:13],
|
|
|
|
|
_FixConfigModeName[13:17],
|
2020-05-08 16:54:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
}
|
2024-07-16 21:14:27 -04:00
|
|
|
|
|
|
|
|
if val, ok := _FixConfigModeNameToValueMap[strings.ToLower(s)]; ok {
|
|
|
|
|
return val, nil
|
|
|
|
|
}
|
2020-05-08 16:54:44 +02:00
|
|
|
return 0, fmt.Errorf("%s does not belong to FixConfigMode values", s)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FixConfigModeValues returns all values of the enum
|
|
|
|
|
func FixConfigModeValues() []FixConfigMode {
|
|
|
|
|
return _FixConfigModeValues
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-16 21:14:27 -04:00
|
|
|
// FixConfigModeStrings returns a slice of all String values of the enum
|
|
|
|
|
func FixConfigModeStrings() []string {
|
|
|
|
|
strs := make([]string, len(_FixConfigModeNames))
|
|
|
|
|
copy(strs, _FixConfigModeNames)
|
|
|
|
|
return strs
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-08 16:54:44 +02:00
|
|
|
// 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
|
|
|
|
|
}
|