pull/9139/head
Adrien Delorme 6 years ago
parent 42a05e1e80
commit 7e45a1e950

@ -0,0 +1,51 @@
// 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
}

@ -14,13 +14,13 @@ type BuildGetter interface {
GetBuilds(GetBuildsOptions) ([]Build, hcl.Diagnostics)
}
//go:generate enumer -type FixMode
//go:generate enumer -type FixConfigMode
type FixConfigMode int
const (
Stdout FixConfigMode = 0
Inplace FixConfigMode = 1
Diff FixConfigMode = 2
Stdout FixConfigMode = iota
Inplace
Diff
)
type FixConfigOptions struct {

Loading…
Cancel
Save