{"modulePath":"github.com/letscloud-community/packer-plugin-letscloud","version":"v0.1.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package letscloud\n\nhelpers.go\n\n## Constants\n\n```go\nconst BuilderId = \"packer.letscloud\"\n```\n\n## Functions\n\n```go\nfunc NewArtifact(values map[string]interface{}) packer.Artifact\n```\nNewArtifact creates a new Artifact.\n\n## Types\n\n```go\ntype Artifact struct {\n\tStateData map[string]interface{}\n}\n```\nArtifact implements the packer.Artifact interface.\n\n```go\nfunc (a *Artifact) BuilderId() string\n```\nBuilderId returns the builder ID.\n\n```go\nfunc (a *Artifact) Config() map[string]interface{}\n```\nConfig returns the artifact configuration.\n\n```go\nfunc (a *Artifact) Destroy() error\n```\nDestroy is a no-op for this artifact.\n\n```go\nfunc (a *Artifact) Files() []string\n```\nFiles returns the files associated with this artifact.\n\n```go\nfunc (a *Artifact) Id() string\n```\n\n```go\nfunc (a *Artifact) PrintOnUI(ui packer.Ui) error\n```\nPrintOnUI displays the artifact details on the UI. Note: Generated passwords are not displayed to maintain security best practices.\n\n```go\nfunc (a *Artifact) Serialize() ([]byte, error)\n```\nSerialize serializes the artifact to JSON.\n\n```go\nfunc (a *Artifact) State(name string) interface{}\n```\nState returns the state data of the artifact.\n\n```go\nfunc (a *Artifact) String() string\n```\nString returns a description of the artifact.\n\n```go\ntype Builder struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (b *Builder) ConfigSpec() hcldec.ObjectSpec\n```\n\n```go\nfunc (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error)\n```\n\n```go\nfunc (b *Builder) Run(ctx context.Context, ui packer.Ui, hook packer.Hook) (packer.Artifact, error)\n```\n\n```go\ntype Config struct {\n\tcommon.PackerConfig `mapstructure:\",squash\"`\n\tComm                communicator.Config `mapstructure:\",squash\"`\n\n\tAPIKey       string `mapstructure:\"api_key\"`\n\tLocationSlug string `mapstructure:\"location_slug\"`\n\tPlanSlug     string `mapstructure:\"plan_slug\"`\n\tImageSlug    string `mapstructure:\"image_slug\"`\n\tSSHSlug      string `mapstructure:\"ssh_slug\"`\n\tHostname     string `mapstructure:\"hostname\"`\n\tLabel        string `mapstructure:\"label\"`\n\tSnapshotName string `mapstructure:\"snapshot_name\"`\n\tStateTimeout string `mapstructure:\"state_timeout,omitempty\"` // Optional: Defaults to 10m\n\tKeepInstance bool   `mapstructure:\"keep_instance\"`           // Optional: Defaults to false\n\t// contains filtered or unexported fields\n}\n```\nConfig represents the configuration for the LetsCloud builder.\n\n```go\nfunc (c *Config) ConfigSpec() hcldec.ObjectSpec\n```\nConfigSpec returns the HCL object spec for the configuration.\n\n```go\nfunc (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }\n```\nFlatMapstructure 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.\n\n```go\nfunc (c *Config) Prepare(raws ...interface{}) error\n```\nPrepare decodes the configuration and validates required fields.\n\n```go\ntype FlatConfig struct {\n\tPackerBuildName           *string           `mapstructure:\"packer_build_name\" cty:\"packer_build_name\" hcl:\"packer_build_name\"`\n\tPackerBuilderType         *string           `mapstructure:\"packer_builder_type\" cty:\"packer_builder_type\" hcl:\"packer_builder_type\"`\n\tPackerCoreVersion         *string           `mapstructure:\"packer_core_version\" cty:\"packer_core_version\" hcl:\"packer_core_version\"`\n\tPackerDebug               *bool             `mapstructure:\"packer_debug\" cty:\"packer_debug\" hcl:\"packer_debug\"`\n\tPackerForce               *bool             `mapstructure:\"packer_force\" cty:\"packer_force\" hcl:\"packer_force\"`\n\tPackerOnError             *string           `mapstructure:\"packer_on_error\" cty:\"packer_on_error\" hcl:\"packer_on_error\"`\n\tPackerUserVars            map[string]string `mapstructure:\"packer_user_variables\" cty:\"packer_user_variables\" hcl:\"packer_user_variables\"`\n\tPackerSensitiveVars       []string          `mapstructure:\"packer_sensitive_variables\" cty:\"packer_sensitive_variables\" hcl:\"packer_sensitive_variables\"`\n\tType                      *string           `mapstructure:\"communicator\" cty:\"communicator\" hcl:\"communicator\"`\n\tPauseBeforeConnect        *string           `mapstructure:\"pause_before_connecting\" cty:\"pause_before_connecting\" hcl:\"pause_before_connecting\"`\n\tSSHHost                   *string           `mapstructure:\"ssh_host\" cty:\"ssh_host\" hcl:\"ssh_host\"`\n\tSSHPort                   *int              `mapstructure:\"ssh_port\" cty:\"ssh_port\" hcl:\"ssh_port\"`\n\tSSHUsername               *string           `mapstructure:\"ssh_username\" cty:\"ssh_username\" hcl:\"ssh_username\"`\n\tSSHPassword               *string           `mapstructure:\"ssh_password\" cty:\"ssh_password\" hcl:\"ssh_password\"`\n\tSSHKeyPairName            *string           `mapstructure:\"ssh_keypair_name\" undocumented:\"true\" cty:\"ssh_keypair_name\" hcl:\"ssh_keypair_name\"`\n\tSSHTemporaryKeyPairName   *string           `mapstructure:\"temporary_key_pair_name\" undocumented:\"true\" cty:\"temporary_key_pair_name\" hcl:\"temporary_key_pair_name\"`\n\tSSHTemporaryKeyPairType   *string           `mapstructure:\"temporary_key_pair_type\" cty:\"temporary_key_pair_type\" hcl:\"temporary_key_pair_type\"`\n\tSSHTemporaryKeyPairBits   *int              `mapstructure:\"temporary_key_pair_bits\" cty:\"temporary_key_pair_bits\" hcl:\"temporary_key_pair_bits\"`\n\tSSHCiphers                []string          `mapstructure:\"ssh_ciphers\" cty:\"ssh_ciphers\" hcl:\"ssh_ciphers\"`\n\tSSHClearAuthorizedKeys    *bool             `mapstructure:\"ssh_clear_authorized_keys\" cty:\"ssh_clear_authorized_keys\" hcl:\"ssh_clear_authorized_keys\"`\n\tSSHKEXAlgos               []string          `mapstructure:\"ssh_key_exchange_algorithms\" cty:\"ssh_key_exchange_algorithms\" hcl:\"ssh_key_exchange_algorithms\"`\n\tSSHPrivateKeyFile         *string           `mapstructure:\"ssh_private_key_file\" undocumented:\"true\" cty:\"ssh_private_key_file\" hcl:\"ssh_private_key_file\"`\n\tSSHCertificateFile        *string           `mapstructure:\"ssh_certificate_file\" cty:\"ssh_certificate_file\" hcl:\"ssh_certificate_file\"`\n\tSSHPty                    *bool             `mapstructure:\"ssh_pty\" cty:\"ssh_pty\" hcl:\"ssh_pty\"`\n\tSSHTimeout                *string           `mapstructure:\"ssh_timeout\" cty:\"ssh_timeout\" hcl:\"ssh_timeout\"`\n\tSSHWaitTimeout            *string           `mapstructure:\"ssh_wait_timeout\" undocumented:\"true\" cty:\"ssh_wait_timeout\" hcl:\"ssh_wait_timeout\"`\n\tSSHAgentAuth              *bool             `mapstructure:\"ssh_agent_auth\" undocumented:\"true\" cty:\"ssh_agent_auth\" hcl:\"ssh_agent_auth\"`\n\tSSHDisableAgentForwarding *bool             `mapstructure:\"ssh_disable_agent_forwarding\" cty:\"ssh_disable_agent_forwarding\" hcl:\"ssh_disable_agent_forwarding\"`\n\tSSHHandshakeAttempts      *int              `mapstructure:\"ssh_handshake_attempts\" cty:\"ssh_handshake_attempts\" hcl:\"ssh_handshake_attempts\"`\n\tSSHBastionHost            *string           `mapstructure:\"ssh_bastion_host\" cty:\"ssh_bastion_host\" hcl:\"ssh_bastion_host\"`\n\tSSHBastionPort            *int              `mapstructure:\"ssh_bastion_port\" cty:\"ssh_bastion_port\" hcl:\"ssh_bastion_port\"`\n\tSSHBastionAgentAuth       *bool             `mapstructure:\"ssh_bastion_agent_auth\" cty:\"ssh_bastion_agent_auth\" hcl:\"ssh_bastion_agent_auth\"`\n\tSSHBastionUsername        *string           `mapstructure:\"ssh_bastion_username\" cty:\"ssh_bastion_username\" hcl:\"ssh_bastion_username\"`\n\tSSHBastionPassword        *string           `mapstructure:\"ssh_bastion_password\" cty:\"ssh_bastion_password\" hcl:\"ssh_bastion_password\"`\n\tSSHBastionInteractive     *bool             `mapstructure:\"ssh_bastion_interactive\" cty:\"ssh_bastion_interactive\" hcl:\"ssh_bastion_interactive\"`\n\tSSHBastionPrivateKeyFile  *string           `mapstructure:\"ssh_bastion_private_key_file\" cty:\"ssh_bastion_private_key_file\" hcl:\"ssh_bastion_private_key_file\"`\n\tSSHBastionCertificateFile *string           `mapstructure:\"ssh_bastion_certificate_file\" cty:\"ssh_bastion_certificate_file\" hcl:\"ssh_bastion_certificate_file\"`\n\tSSHFileTransferMethod     *string           `mapstructure:\"ssh_file_transfer_method\" cty:\"ssh_file_transfer_method\" hcl:\"ssh_file_transfer_method\"`\n\tSSHProxyHost              *string           `mapstructure:\"ssh_proxy_host\" cty:\"ssh_proxy_host\" hcl:\"ssh_proxy_host\"`\n\tSSHProxyPort              *int              `mapstructure:\"ssh_proxy_port\" cty:\"ssh_proxy_port\" hcl:\"ssh_proxy_port\"`\n\tSSHProxyUsername          *string           `mapstructure:\"ssh_proxy_username\" cty:\"ssh_proxy_username\" hcl:\"ssh_proxy_username\"`\n\tSSHProxyPassword          *string           `mapstructure:\"ssh_proxy_password\" cty:\"ssh_proxy_password\" hcl:\"ssh_proxy_password\"`\n\tSSHKeepAliveInterval      *string           `mapstructure:\"ssh_keep_alive_interval\" cty:\"ssh_keep_alive_interval\" hcl:\"ssh_keep_alive_interval\"`\n\tSSHReadWriteTimeout       *string           `mapstructure:\"ssh_read_write_timeout\" cty:\"ssh_read_write_timeout\" hcl:\"ssh_read_write_timeout\"`\n\tSSHRemoteTunnels          []string          `mapstructure:\"ssh_remote_tunnels\" cty:\"ssh_remote_tunnels\" hcl:\"ssh_remote_tunnels\"`\n\tSSHLocalTunnels           []string          `mapstructure:\"ssh_local_tunnels\" cty:\"ssh_local_tunnels\" hcl:\"ssh_local_tunnels\"`\n\tSSHPublicKey              []byte            `mapstructure:\"ssh_public_key\" undocumented:\"true\" cty:\"ssh_public_key\" hcl:\"ssh_public_key\"`\n\tSSHPrivateKey             []byte            `mapstructure:\"ssh_private_key\" undocumented:\"true\" cty:\"ssh_private_key\" hcl:\"ssh_private_key\"`\n\tWinRMUser                 *string           `mapstructure:\"winrm_username\" cty:\"winrm_username\" hcl:\"winrm_username\"`\n\tWinRMPassword             *string           `mapstructure:\"winrm_password\" cty:\"winrm_password\" hcl:\"winrm_password\"`\n\tWinRMHost                 *string           `mapstructure:\"winrm_host\" cty:\"winrm_host\" hcl:\"winrm_host\"`\n\tWinRMNoProxy              *bool             `mapstructure:\"winrm_no_proxy\" cty:\"winrm_no_proxy\" hcl:\"winrm_no_proxy\"`\n\tWinRMPort                 *int              `mapstructure:\"winrm_port\" cty:\"winrm_port\" hcl:\"winrm_port\"`\n\tWinRMTimeout              *string           `mapstructure:\"winrm_timeout\" cty:\"winrm_timeout\" hcl:\"winrm_timeout\"`\n\tWinRMUseSSL               *bool             `mapstructure:\"winrm_use_ssl\" cty:\"winrm_use_ssl\" hcl:\"winrm_use_ssl\"`\n\tWinRMInsecure             *bool             `mapstructure:\"winrm_insecure\" cty:\"winrm_insecure\" hcl:\"winrm_insecure\"`\n\tWinRMUseNTLM              *bool             `mapstructure:\"winrm_use_ntlm\" cty:\"winrm_use_ntlm\" hcl:\"winrm_use_ntlm\"`\n\tAPIKey                    *string           `mapstructure:\"api_key\" cty:\"api_key\" hcl:\"api_key\"`\n\tLocationSlug              *string           `mapstructure:\"location_slug\" cty:\"location_slug\" hcl:\"location_slug\"`\n\tPlanSlug                  *string           `mapstructure:\"plan_slug\" cty:\"plan_slug\" hcl:\"plan_slug\"`\n\tImageSlug                 *string           `mapstructure:\"image_slug\" cty:\"image_slug\" hcl:\"image_slug\"`\n\tSSHSlug                   *string           `mapstructure:\"ssh_slug\" cty:\"ssh_slug\" hcl:\"ssh_slug\"`\n\tHostname                  *string           `mapstructure:\"hostname\" cty:\"hostname\" hcl:\"hostname\"`\n\tLabel                     *string           `mapstructure:\"label\" cty:\"label\" hcl:\"label\"`\n\tSnapshotName              *string           `mapstructure:\"snapshot_name\" cty:\"snapshot_name\" hcl:\"snapshot_name\"`\n\tStateTimeout              *string           `mapstructure:\"state_timeout,omitempty\" cty:\"state_timeout\" hcl:\"state_timeout\"`\n\tKeepInstance              *bool             `mapstructure:\"keep_instance\" cty:\"keep_instance\" hcl:\"keep_instance\"`\n}\n```\nFlatConfig is an auto-generated flat version of Config. Where the contents of a field with a \\`mapstructure:,squash\\` tag are bubbled up.\n\n```go\nfunc (*FlatConfig) HCL2Spec() map[string]hcldec.Spec\n```\nHCL2Spec 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.\n\n```go\ntype StepCreateInstance struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StepCreateInstance) Cleanup(state multistep.StateBag)\n```\nCleanup is called after Run completes, whether it succeeded or failed.\n\n```go\nfunc (s *StepCreateInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction\n```\nRun executes the StepCreateInstance.\n\n```go\ntype StepCreateSSHKey struct {\n\t// contains filtered or unexported fields\n}\n```\nStepCreateSSHKey defines a step to create a new SSH key.\n\n```go\nfunc (s *StepCreateSSHKey) Cleanup(state multistep.StateBag)\n```\nCleanup is called after Run completes, whether it succeeded or failed.\n\n```go\nfunc (s *StepCreateSSHKey) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction\n```\nRun executes the StepCreateSSHKey.\n\n```go\ntype StepShutdown struct {\n\t// contains filtered or unexported fields\n}\n```\nStepShutdown shuts down the instance after provisioning.\n\n```go\nfunc (s *StepShutdown) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepShutdown) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction\n```\nRun executes the StepShutdown.\n\n```go\ntype StepSnapshot struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *StepSnapshot) Cleanup(state multistep.StateBag)\n```\n\n```go\nfunc (s *StepSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction\n```\nRun executes the StepSnapshot\n\n","path":"github.com/letscloud-community/packer-plugin-letscloud/builder/letscloud","name":"letscloud","synopsis":"helpers.go","isRedistributable":true}
