Documentation ¶
Index ¶
- Constants
- func DeleteDownloadedRelease(zipFile string) error
- func Download(version, goos, goarch string) (string, error)
- func GetBinaryLocation(version string) string
- func GetDownloadLocation() string
- func GetInstallLocation(version string) string
- func IsAlreadyDownloaded(version string) bool
- func UnzipRelease(source, destination string) error
Constants ¶
const ( // TerraformReleasesUrl is the URL used to download Terraform releases from. TerraformReleasesUrl = "https://releases.hashicorp.com/terraform" // MaxRetries is the maximum number of retries for a download. MaxRetries = 3 // RetryTimeInSeconds is the time to wait before retrying a download. RetryTimeInSeconds = 2 // ApplicationDir is the directory where tfversion downloads Terraform releases. ApplicationDir = ".tfversion" // UseDir is the directory where tfversion puts the symlink to the active version. UseDir = "bin" // VersionsDir is the directory where tfversion installs all versions. VersionsDir = "versions" // AliasesDir is the directory where tfversion stores the aliases. AliasesDir = "aliases" // TerraformBinaryName is the name of the Terraform binary. TerraformBinaryName = "terraform" )
Variables ¶
This section is empty.
Functions ¶
func DeleteDownloadedRelease ¶
DeleteDownloadedRelease deletes the downloaded Terraform release zip file to prevent cluttering the filesystem.
func Download ¶
Download downloads the Terraform release zip file for the given version, OS and architecture.
func GetBinaryLocation ¶
GetBinaryLocation returns the path to the Terraform binary for the given version.
func GetDownloadLocation ¶
func GetDownloadLocation() string
GetDownloadLocation returns the directory where tfversion downloads Terraform releases to.
func GetInstallLocation ¶
GetInstallLocation returns the directory where a specific Terraform version is installed to.
func IsAlreadyDownloaded ¶
IsAlreadyDownloaded checks if the given Terraform version is already downloaded and unzipped.
func UnzipRelease ¶
UnzipRelease extracts the Terraform binary from the zip file to the specified destination.
Types ¶
This section is empty.