packer-cn/packer/new_stuff.go

34 lines
783 B
Go
Raw Normal View History

2020-05-08 10:41:47 -04:00
package packer
import "github.com/hashicorp/hcl/v2"
type GetBuildsOptions struct {
// Get builds except the ones that match with except and with only the ones
// that match with. When those are empty everything matches.
Except, Only []string
}
type BuildGetter interface {
// GetBuilds return all possible builds for a config. It also starts them.
// TODO(azr): rename to builder starter ?
GetBuilds(GetBuildsOptions) ([]Build, hcl.Diagnostics)
}
2020-05-08 10:54:44 -04:00
//go:generate enumer -type FixConfigMode
2020-05-08 10:41:47 -04:00
type FixConfigMode int
const (
2020-05-08 10:54:44 -04:00
Stdout FixConfigMode = iota
Inplace
Diff
2020-05-08 10:41:47 -04:00
)
type FixConfigOptions struct {
DiffOnly bool
}
type OtherInterfaceyMacOtherInterfaceFace interface {
// FixConfig will output the config in a fixed manner.
FixConfig(FixConfigOptions) hcl.Diagnostics
}