download

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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

func DeleteDownloadedRelease(zipFile string) error

DeleteDownloadedRelease deletes the downloaded Terraform release zip file to prevent cluttering the filesystem.

func Download

func Download(version, goos, goarch string) (string, error)

Download downloads the Terraform release zip file for the given version, OS and architecture.

func GetBinaryLocation

func GetBinaryLocation(version string) string

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

func GetInstallLocation(version string) string

GetInstallLocation returns the directory where a specific Terraform version is installed to.

func IsAlreadyDownloaded

func IsAlreadyDownloaded(version string) bool

IsAlreadyDownloaded checks if the given Terraform version is already downloaded and unzipped.

func UnzipRelease

func UnzipRelease(source, destination string) error

UnzipRelease extracts the Terraform binary from the zip file to the specified destination.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL