pkg

package
v0.0.0-...-bfee255 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDirExist

func CheckDirExist(dir string) bool

CheckDirExist : check if directory exist dir=path to file return bool

func CheckFileExist

func CheckFileExist(file string) bool

CheckFileExist : check if file exist in directory

func ConvertExecutableExt

func ConvertExecutableExt(fpath string) string

ConvertExecutableExt : convert excutable with local OS extension

func CreateDirIfNotExist

func CreateDirIfNotExist(dir string)

CreateDirIfNotExist : create directory if directory does not exist

func DownloadFromURL

func DownloadFromURL(installLocation string, url string) (string, error)

DownloadFromURL : Downloads the binary from the source url

func GetTFList

func GetTFList(mirrorURL string, preRelease bool) ([]string, error)

GetTFList : Get the list of available terraform version given the hashicorp url

func GetTFURLBody

func GetTFURLBody(mirrorURL string) ([]string, error)

GetTFURLBody : Get list of terraform versions from hashicorp releases

func HTTPClient

func HTTPClient() *http.Client

func Install

func Install(tfversion string, mirrorURL string) (string, error)

Install : Install the provided version in the argument

func InstallTFProvidedModule

func InstallTFProvidedModule(dir string, mirrorURL string) (string, error)

install when tf file is provided

func Path

func Path(value string) string

Path : returns path of directory value=path to file

func RemoveFiles

func RemoveFiles(src string)

RemoveFiles : remove file

func RenameFile

func RenameFile(src string, dest string)

RenameFile : rename file name

func RunTerraform

func RunTerraform(tfBinaryPath string, args ...string) int

func Unzip

func Unzip(src string, dest string) error

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

func ValidVersionFormat

func ValidVersionFormat(version string) bool

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 WaitForLockFile

func WaitForLockFile() (unlock func())

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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