mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-10 09:10:27 -04:00
The lib name for the common components for writing packer_test suites was not clear, and did not follow the convention established in Packer core and plugins. Therefore this commit does two things: first the lib is renamed into common as to follow this convention, and clearly document which components are common to all tests. Also checkers are placed in a subpackage of common, common/check, so that it is clearer what is meant to be used as checks for a command's execution status after it's been run, as part of Assert.
54 lines
2 KiB
Go
54 lines
2 KiB
Go
// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT.
|
|
|
|
package sleeper
|
|
|
|
import (
|
|
"github.com/hashicorp/hcl/v2/hcldec"
|
|
"github.com/zclconf/go-cty/cty"
|
|
)
|
|
|
|
// FlatConfig is an auto-generated flat version of Config.
|
|
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
|
|
type FlatConfig struct {
|
|
Duration *string `mapstructure:"duration" required:"true" cty:"duration" hcl:"duration"`
|
|
}
|
|
|
|
// FlatMapstructure returns a new FlatConfig.
|
|
// FlatConfig is an auto-generated flat version of Config.
|
|
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
|
|
func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
|
|
return new(FlatConfig)
|
|
}
|
|
|
|
// HCL2Spec returns the hcl spec of a Config.
|
|
// This spec is used by HCL to read the fields of Config.
|
|
// The decoded values from this spec will then be applied to a FlatConfig.
|
|
func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec {
|
|
s := map[string]hcldec.Spec{
|
|
"duration": &hcldec.AttrSpec{Name: "duration", Type: cty.String, Required: false},
|
|
}
|
|
return s
|
|
}
|
|
|
|
// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput.
|
|
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
|
|
type FlatDatasourceOutput struct {
|
|
Status *bool `mapstructure:"status" cty:"status" hcl:"status"`
|
|
}
|
|
|
|
// FlatMapstructure returns a new FlatDatasourceOutput.
|
|
// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput.
|
|
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
|
|
func (*DatasourceOutput) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
|
|
return new(FlatDatasourceOutput)
|
|
}
|
|
|
|
// HCL2Spec returns the hcl spec of a DatasourceOutput.
|
|
// This spec is used by HCL to read the fields of DatasourceOutput.
|
|
// The decoded values from this spec will then be applied to a FlatDatasourceOutput.
|
|
func (*FlatDatasourceOutput) HCL2Spec() map[string]hcldec.Spec {
|
|
s := map[string]hcldec.Spec{
|
|
"status": &hcldec.AttrSpec{Name: "status", Type: cty.Bool, Required: false},
|
|
}
|
|
return s
|
|
}
|