{"modulePath":"github.com/stackpointcloud/packer","version":"v0.2.2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package common\n\n## Functions\n\n```go\nfunc CheckUnusedConfig(md *mapstructure.Metadata) *packer.MultiError\n```\nCheckUnusedConfig is a helper that makes sure that the there are no unused configuration keys, properly ignoring keys that don't matter.\n\n```go\nfunc DecodeConfig(target interface{}, raws ...interface{}) (*mapstructure.Metadata, error)\n```\nDecodeConfig is a helper that handles decoding raw configuration using mapstructure. It returns the metadata and any errors that may happen. If you need extra configuration for mapstructure, you should configure it manually and not use this helper function.\n\n```go\nfunc DownloadableURL(original string) (string, error)\n```\nDownloadableURL processes a URL that may also be a file path and returns a completely valid URL. For example, the original URL might be \"local/file.iso\" which isn't a valid URL. DownloadableURL will return \"file:///local/file.iso\"\n\n```go\nfunc HashForType(t string) hash.Hash\n```\nHashForType returns the Hash implementation for the given string type, or nil if the type is not supported.\n\n```go\nfunc MultistepDebugFn(ui packer.Ui) multistep.DebugPauseFn\n```\nMultistepDebugFn will return a proper multistep.DebugPauseFn to use for debugging if you're using multistep in your builder.\n\n## Types\n\n```go\ntype DownloadClient struct {\n\t// contains filtered or unexported fields\n}\n```\nA DownloadClient helps download, verify checksums, etc.\n\n```go\nfunc NewDownloadClient(c *DownloadConfig) *DownloadClient\n```\nNewDownloadClient returns a new DownloadClient for the given configuration.\n\n```go\nfunc (d *DownloadClient) Cancel()\n```\n\n```go\nfunc (d *DownloadClient) Get() (string, error)\n```\n\n```go\nfunc (d *DownloadClient) PercentProgress() uint\n```\nPercentProgress returns the download progress as a percentage.\n\n```go\nfunc (d *DownloadClient) VerifyChecksum(path string) (bool, error)\n```\nVerifyChecksum tests that the path matches the checksum for the download.\n\n```go\ntype DownloadConfig struct {\n\t// The source URL in the form of a string.\n\tUrl string\n\n\t// This is the path to download the file to.\n\tTargetPath string\n\n\t// DownloaderMap maps a schema to a Download.\n\tDownloaderMap map[string]Downloader\n\n\t// If true, this will copy even a local file to the target\n\t// location. If false, then it will \"download\" the file by just\n\t// returning the local path to the file.\n\tCopyFile bool\n\n\t// The hashing implementation to use to checksum the downloaded file.\n\tHash hash.Hash\n\n\t// The checksum for the downloaded file. The hash implementation configuration\n\t// for the downloader will be used to verify with this checksum after\n\t// it is downloaded.\n\tChecksum []byte\n}\n```\nDownloadConfig is the configuration given to instantiate a new download instance. Once a configuration is used to instantiate a download client, it must not be modified.\n\n```go\ntype Downloader interface {\n\tCancel()\n\tDownload(io.Writer, *url.URL) error\n\tProgress() uint\n\tTotal() uint\n}\n```\nA downloader is responsible for actually taking a remote URL and downloading it.\n\n```go\ntype HTTPDownloader struct {\n\t// contains filtered or unexported fields\n}\n```\nHTTPDownloader is an implementation of Downloader that downloads files over HTTP.\n\n```go\nfunc (*HTTPDownloader) Cancel()\n```\n\n```go\nfunc (d *HTTPDownloader) Download(dst io.Writer, src *url.URL) error\n```\n\n```go\nfunc (d *HTTPDownloader) Progress() uint\n```\n\n```go\nfunc (d *HTTPDownloader) Total() uint\n```\n\n```go\ntype PackerConfig struct {\n\tPackerBuildName string `mapstructure:\"packer_build_name\"`\n\tPackerDebug     bool   `mapstructure:\"packer_debug\"`\n\tPackerForce     bool   `mapstructure:\"packer_force\"`\n}\n```\nPackerConfig is a struct that contains the configuration keys that are sent by packer, properly tagged already so mapstructure can load them. Embed this structure into your configuration class to get it.\n\n```go\ntype StepConnectSSH struct {\n\t// SSHAddress is a function that returns the TCP address to connect to\n\t// for SSH. This is a function so that you can query information\n\t// if necessary for this address.\n\tSSHAddress func(map[string]interface{}) (string, error)\n\n\t// SSHConfig is a function that returns the proper client configuration\n\t// for SSH access.\n\tSSHConfig func(map[string]interface{}) (*gossh.ClientConfig, error)\n\n\t// SSHWaitTimeout is the total timeout to wait for SSH to become available.\n\tSSHWaitTimeout time.Duration\n\t// contains filtered or unexported fields\n}\n```\nStepConnectSSH is a multistep Step implementation that waits for SSH to become available. It gets the connection information from a single configuration when creating the step.\n\nUses:\n\n\tui packer.Ui\n\nProduces:\n\n\tcommunicator packer.Communicator\n\n```go\nfunc (s *StepConnectSSH) Cleanup(map[string]interface{})\n```\n\n```go\nfunc (s *StepConnectSSH) Run(state map[string]interface{}) multistep.StepAction\n```\n\n```go\ntype StepCreateFloppy struct {\n\tFiles []string\n\t// contains filtered or unexported fields\n}\n```\nStepCreateFloppy will create a floppy disk with the given files. The floppy disk doesn't support sub-directories. Only files at the root level are supported.\n\n```go\nfunc (s *StepCreateFloppy) Cleanup(map[string]interface{})\n```\n\n```go\nfunc (s *StepCreateFloppy) Run(state map[string]interface{}) multistep.StepAction\n```\n\n```go\ntype StepProvision struct{}\n```\nStepProvision runs the provisioners.\n\nUses:\n\n\tcommunicator packer.Communicator\n\thook         packer.Hook\n\tui           packer.Ui\n\nProduces:\n\n\t\u003cnothing\u003e\n\n```go\nfunc (*StepProvision) Cleanup(map[string]interface{})\n```\n\n```go\nfunc (*StepProvision) Run(state map[string]interface{}) multistep.StepAction\n```\n\n","path":"github.com/stackpointcloud/packer/builder/common","name":"common","synopsis":"","isRedistributable":true}
