Documentation ¶
Index ¶
- Variables
- func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error
- func DetectContext(raws ...interface{}) (*interpolate.Context, error)
- func DetectContextData(raws ...interface{}) (map[interface{}]interface{}, []interface{})
- type DecodeOpts
- type FlatKeyValue
- type FlatKeyValueFilter
- type FlatNameValue
- type FlatNameValueFilter
- type KeyValue
- type KeyValueFilter
- type KeyValues
- type NameValue
- type NameValueFilter
- type NameValues
- type Trilean
Constants ¶
This section is empty.
Variables ¶
var DefaultDecodeHookFuncs = []mapstructure.DecodeHookFunc{ uint8ToStringHook, stringToTrilean, mapstructure.StringToSliceHookFunc(","), mapstructure.StringToTimeDurationHookFunc(), }
var DeprecatedOptions = map[string][]string{ "*": []string{"iso_md5", "ssh_key_path", "ssh_disable_agent", "ssh_host_port_min", "ssh_host_port_max", "ssh_skip_nat_mapping", "ssh_wait_timeout", "iso_checksum_url", "iso_checksum_type"}, "*amazon*": []string{"shutdown_behaviour", "enhanced_networking", "ssh_private_ip", "temporary_security_group_source_cidr", "clean_ami_name", "spot_price_auto_product"}, "Azure*": []string{"clean_image_name", "exlude_from_latest"}, "MSOpenTech.hyperv": []string{"vhd_temp_path", "clone_from_vmxc_path", "cpu", "ram_size"}, "ansible": []string{"galaxycommand"}, "hashicorp.scaleway": []string{"access_key"}, "jetbrains.vsphere": []string{"network_card", "network", "networkCard", "disk_size", "disk_thin_provisioned", "disk_eagerly_scrub"}, "mitchellh.virtualbox": []string{"guest_additions_attach"}, "packer.docker": []string{"login_email"}, "packer.googlecompute": []string{"clean_image_name"}, "packer.parallels": []string{"headless", "parallels_tools_host_path", "guest_os_distribution"}, "packer.post-processor.docker-import": []string{"login_email"}, "packer.post-processor.docker-tag": []string{"tag"}, "packer.post-processor.manifest": []string{"filename"}, "transcend.qemu": []string{"ssh_host_port_max", "ssh_host_port_min"}, }
Functions ¶
func Decode ¶
func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error
Decode decodes the configuration into the target and optionally automatically interpolates all the configuration as it goes.
func DetectContext ¶
func DetectContext(raws ...interface{}) (*interpolate.Context, error)
DetectContext builds a base interpolate.Context, automatically detecting things like user variables from the raw configuration params.
func DetectContextData ¶
func DetectContextData(raws ...interface{}) (map[interface{}]interface{}, []interface{})
Types ¶
type DecodeOpts ¶
type DecodeOpts struct { // Metadata, if non-nil, will be set to the metadata post-decode Metadata *mapstructure.Metadata // Interpolate, if true, will automatically interpolate the // configuration with the given InterpolateContext. User variables // will be automatically detected and added in-place to the given // context. Interpolate bool InterpolateContext *interpolate.Context InterpolateFilter *interpolate.RenderFilter // PluginType is the BuilderID, etc of the plugin -- it is used to // determine whether to tell the user to "fix" their template if an // unknown option is a deprecated one for this plugin type. PluginType string DecodeHooks []mapstructure.DecodeHookFunc }
DecodeOpts are the options for decoding configuration.
type FlatKeyValue ¶
type FlatKeyValue struct { Key *string `cty:"key" hcl:"key"` Value *string `cty:"value" hcl:"value"` }
FlatKeyValue is an auto-generated flat version of KeyValue. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatKeyValueFilter ¶
type FlatKeyValueFilter struct { Filters map[string]string `cty:"filters" hcl:"filters"` Filter []FlatKeyValue `cty:"filter" hcl:"filter"` }
FlatKeyValueFilter is an auto-generated flat version of KeyValueFilter. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatNameValue ¶
type FlatNameValue struct { Name *string `cty:"name" hcl:"name"` Value *string `cty:"value" hcl:"value"` }
FlatNameValue is an auto-generated flat version of NameValue. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatNameValueFilter ¶
type FlatNameValueFilter struct { Filters map[string]string `cty:"filters" hcl:"filters"` Filter []FlatNameValue `cty:"filter" hcl:"filter"` }
FlatNameValueFilter is an auto-generated flat version of NameValueFilter. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type KeyValue ¶
These are used to convert HCL blocks to key-value pairs
func (*KeyValue) FlatMapstructure ¶
FlatMapstructure returns a new FlatKeyValue. FlatKeyValue is an auto-generated flat version of KeyValue. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type KeyValueFilter ¶
func (*KeyValueFilter) Empty ¶
func (kvf *KeyValueFilter) Empty() bool
func (*KeyValueFilter) FlatMapstructure ¶
func (*KeyValueFilter) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatKeyValueFilter. FlatKeyValueFilter is an auto-generated flat version of KeyValueFilter. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*KeyValueFilter) Prepare ¶
func (kvf *KeyValueFilter) Prepare() []error
type NameValue ¶
func (*NameValue) FlatMapstructure ¶
FlatMapstructure returns a new FlatNameValue. FlatNameValue is an auto-generated flat version of NameValue. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
type NameValueFilter ¶
type NameValueFilter struct { Filters map[string]string Filter NameValues }
func (*NameValueFilter) Empty ¶
func (nvf *NameValueFilter) Empty() bool
func (*NameValueFilter) FlatMapstructure ¶
func (*NameValueFilter) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }
FlatMapstructure returns a new FlatNameValueFilter. FlatNameValueFilter is an auto-generated flat version of NameValueFilter. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*NameValueFilter) Prepare ¶
func (nvf *NameValueFilter) Prepare() []error
type NameValues ¶
type NameValues []NameValue
type Trilean ¶
type Trilean uint8