Documentation
¶
Overview ¶
inspired by a similar library from age, but they don't export functions so we can't just import and re-use them
Index ¶
- func CommandExists(cmd string) bool
- func Compress(files []string, buf io.Writer) error
- func CopyFile(src, dst string) (int64, error)
- func DirExists(path string) (bool, error)
- func DownloadFile(filepath string, url string) error
- func GenerateMACAddress() (string, error)
- func GenerateRandomAlias() string
- func GetImageURL(version string) string
- func PassphrasePromptForDecryption() (string, error)
- func PassphrasePromptForEncryption() (string, error)
- func Ping(ip string, port string) error
- func Retry(attempts int, sleep time.Duration, f func() error) (err error)
- func StringSliceContains(s []string, e string) bool
- func SupportsHugePages() (bool, error)
- func Uncompress(source string, destination string) error
- type CmdResult
- type Credential
- type CredentialType
- type PortMap
- type Protocol
- type WriteCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandExists ¶
func DownloadFile ¶
func GenerateRandomAlias ¶
func GenerateRandomAlias() string
func GetImageURL ¶
func StringSliceContains ¶
StringSliceContains check if string value is in []string
func Uncompress ¶
Uncompress uncompresses gzip
Types ¶
type Credential ¶
type Credential struct { CRType CredentialType CR string }
func GetCredential ¶
func GetCredential(config string) (Credential, error)
credential backends: raw, env, ssh-agent * if you want to store credentials in the macOS keychain, configure your SSH agent to use the keychain * - raw: "raw::password" (password is a string directly after "raw::" prefix) * - env: "env::PASS_VAR" (password is stored in environment variable $PASS_VAR) * - ssh-agent: "ssh::HOST" (credential is stored in ssh-agent and configured for use with host HOST in the ssh config)
* `ssh-agent` is the most secure by far, as it allows certificate-based authentication rather than using passwords. * If `ssh-agent` is configured and working with certificate-based authentication, `PasswordAuthentication no` can be * set in `/etc/ssh/sshd_config` to significantly harden the VM. * * `env` is more secure than `raw`, and may be useful for automation using macpine on systems where configuring `ssh-agent` * is inconvenient.
type WriteCounter ¶
type WriteCounter struct {
Total uint64
}
func (WriteCounter) PrintProgress ¶
func (wc WriteCounter) PrintProgress()