Documentation
¶
Index ¶
- func AddRecent(requestedVersion string)
- func ChangeSymlink(binVersionPath string, binPath string)
- func CheckDirExist(dir string) bool
- func CheckDirHasTGBin(dir, prefix string) bool
- func CheckDirWritable(dir string) bool
- func CheckFileExist(file string) bool
- func CheckSymlink(symlinkPath string) bool
- func ConvertExecutableExt(fpath string) string
- func CreateDirIfNotExist(dir string)
- func CreateRecentFile(requestedVersion string)
- func CreateSymlink(cwd string, dir string)
- func DownloadFromURL(installLocation string, url string) (string, error)
- func FileExists(filename string) bool
- func GetAppList(gruntURLPage string) []string
- func GetCurrentDirectory() string
- func GetFileName(configfile string) string
- func GetHomeDirectory() string
- func GetInstallLocation() string
- func GetRecentVersions() ([]string, error)
- func GetSemver(tgconstraint *string, proxyUrl string) (string, error)
- func Install(tgversion string, usrBinPath string, mirrorURL string) string
- func InstallableBinLocation(userBinPath string) string
- func IsDirEmpty(name string) bool
- func Path(value string) string
- func PrintCreateDirStmt(unableDir string, writable string)
- func PrintInvalidTFVersion()
- func PrintInvalidTGVersion()
- func ReadLines(path string) (lines []string, err error)
- func ReadingFileMsg(filename string)
- func RemoveDuplicateVersions(elements []string) []string
- func RemoveFiles(src string)
- func RemoveSymlink(symlinkPath string)
- func RenameFile(src string, dest string)
- func RetrieveFileContents(file string) string
- func SemVerParser(tfconstraint *string, tflist []string) (string, error)
- func ValidVersionFormat(version string) bool
- func VersionExist(val interface{}, array interface{}) (exists bool)
- func WriteLines(lines []string, path string) (err error)
- type Command
- type ListVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeSymlink ¶
ChangeSymlink : move symlink to existing binary
func CheckDirExist ¶
CheckDirExist : check if directory exist dir=path to file return path to directory
func CheckDirHasTGBin ¶
CheckDirHasTGBin : // check binary exist (TODO UNIT TEST)
func CheckDirWritable ¶
Check if user has permission to directory : dir=path to file return bool
func CheckFileExist ¶
CheckFileExist : check if file exist in directory
func ConvertExecutableExt ¶
ConvertExecutableExt : convert excutable with local OS extension
func CreateDirIfNotExist ¶
func CreateDirIfNotExist(dir string)
CreateDirIfNotExist : create directory if directory does not exist
func CreateRecentFile ¶
func CreateRecentFile(requestedVersion string)
CreateRecentFile : create a recent file
func CreateSymlink ¶
CreateSymlink : create symlink CreateSymlink : create symlink
func DownloadFromURL ¶
DownloadFromURL : Downloads the binary from the source url
func FileExists ¶
FileExists checks if a file exists and is not a directory before we try using it to prevent further errors.
func GetAppList ¶
func GetCurrentDirectory ¶
func GetCurrentDirectory() string
func GetFileName ¶
GetFileName : remove file ext. .tgswitch.config returns .tgswitch
func GetInstallLocation ¶
func GetInstallLocation() string
GetInstallLocation : get location where the terragrunt binary will be installed, will create a directory in the home location if it does not exist
func GetRecentVersions ¶
GetRecentVersions : get recent version from file
func GetSemver ¶
GetSemver : returns version that will be installed based on server constaint provided
func InstallableBinLocation ¶
InstallableBinLocation : Checks if terragrunt is installable in the location provided by the user. If not, create $HOME/bin. Ask users to add $HOME/bin to $PATH Return $HOME/bin as install location
func IsDirEmpty ¶
IsDirEmpty : check if directory is empty (TODO UNIT TEST)
func PrintCreateDirStmt ¶
func RemoveDuplicateVersions ¶
RemoveDuplicateVersions : remove duplicate version
func RetrieveFileContents ¶
retrive file content of regular file
func SemVerParser ¶
ValidateSemVer : Goes through the list of terragrunt version, return a valid tf version for contraint provided
func ValidVersionFormat ¶
ValidVersionFormat : returns valid version format
For example: 0.1.2 = valid
// For example: 0.1.2-beta1 = valid // For example: 0.1.2-alpha = valid // For example: a.1.2 = invalid // For example: 0.1. 2 = invalid
func VersionExist ¶
func VersionExist(val interface{}, array interface{}) (exists bool)
VersionExist : check if requested version exist
func WriteLines ¶
WriteLines : writes into file
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command : type string
type ListVersion ¶
type ListVersion struct {
Versions []string `json:"Versions"`
}