Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ClearCache bool
ClearCache variable for clear-cache flag
Functions ¶
func IsLatestVersion ¶
IsLatestVersion returns true if installed program is latest version.
Types ¶
type Command ¶
Command defines command, version args and regexp to find version number.
func (*Command) GetFullPath ¶
GetFullPath returns the full path to the command
func (*Command) GetLocalVersion ¶
GetLocalVersion runs Cmd with versionArg and finds version using versionRegexp, which it returns.
func (*Command) IsInstalled ¶
IsInstalled checks if command is installed and returns boolean
type GithubDirectDownloadProgram ¶
type GithubDirectDownloadProgram struct {
GithubProgram
}
GithubDirectDownloadProgram downloads a file directly
func (*GithubDirectDownloadProgram) DownloadLatestVersion ¶
func (p *GithubDirectDownloadProgram) DownloadLatestVersion() string
DownloadLatestVersion downloads the latest release and puts it into the bindir
type GithubDownloadUntarFileProgram ¶
type GithubDownloadUntarFileProgram struct { GithubProgram Filename string }
GithubDownloadUntarFileProgram downloads a tarball and extracts a single file from it
func (*GithubDownloadUntarFileProgram) DownloadLatestVersion ¶
func (p *GithubDownloadUntarFileProgram) DownloadLatestVersion() string
DownloadLatestVersion downloads and untars a file to the bindir
type GithubDownloadUnzipFileProgram ¶
type GithubDownloadUnzipFileProgram struct { GithubProgram Filename string }
GithubDownloadUnzipFileProgram downloads a zip-file and extracts a single file from it
func (*GithubDownloadUnzipFileProgram) DownloadLatestVersion ¶
func (p *GithubDownloadUnzipFileProgram) DownloadLatestVersion() string
DownloadLatestVersion downloads and unzips a file to the bindir
type GithubProgram ¶
type GithubProgram struct { Command GithubOwner string GithubRepo string ReleaseName string // Will be appended when generating Github download URL. Ex: kustomize_{VERSION}_linux_amd64 DownloadURL string // Optional, will be used instead of generating URL. PreRelease bool // Accept prereleases. Defaults to false TagName string // Optional, will be used to find release. Ex: kustomize will find kustomize/v3.3.0. Used when multiple programs are released from the same repo. }
GithubProgram is a Program released via Github
func (*GithubProgram) GetLatestVersion ¶
func (p *GithubProgram) GetLatestVersion() (string, string, error)
GetLatestVersion returns the latest version available
type HashicorpProgram ¶
type HashicorpProgram struct {
Command
}
HashicorpProgram is for Hashicorp programs
func (*HashicorpProgram) DownloadLatestVersion ¶
func (p *HashicorpProgram) DownloadLatestVersion() string
DownloadLatestVersion downloads and extracts the latest version
func (*HashicorpProgram) GetLatestVersion ¶
func (p *HashicorpProgram) GetLatestVersion() (string, string, error)
GetLatestVersion returns the latest version number available