Documentation ¶
Overview ¶
Package releases manages terraform releases.
Index ¶
Constants ¶
const ( DefaultTerraformVersion = "1.6.0" LatestVersionString = "latest" )
Variables ¶
This section is empty.
Functions ¶
func NewDownloader ¶
func NewDownloader(destdir string) *downloader
NewDownloader constructs a terraform downloader, with destdir set as the parent directory into which the binaries are downloaded. Pass an empty string to use a default.
Types ¶
type Service ¶
func NewService ¶
func (Service) Download ¶ added in v0.2.2
Download ensures the given version of terraform is available on the local filesystem and returns its path. Thread-safe: if a Download is in-flight and another Download is requested then it'll be made to wait until the former has finished.
func (*Service) GetLatest ¶
GetLatest returns the latest terraform version and the time when it was fetched; if it has not yet been fetched then the default version is returned instead along with zero time.
func (*Service) StartLatestChecker ¶ added in v0.2.2
StartLatestChecker starts the latest checker go routine, checking the Hashicorp API endpoint for a new latest version.