Documentation
¶
Index ¶
- Variables
- func AppendDirToPath(pathTemplate string, pars ...any) error
- func AppendDirToPathVariable(pathTemplate string, pars ...any) error
- func CheckErrorWithMsg(err error, format string, pars ...any) bool
- func CheckErrorWithTagAndMsg(err error, format string, pars ...any) bool
- func CheckVHiveRepo() error
- func CleanEnvironment() error
- func CleanUpTmpDir() error
- func CloneRepoToTmpDir(branch string, urlTemplate string, pars ...any) (string, error)
- func CopyToDir(source string, target string, privileged bool) error
- func CreateLogs(logDir string, logFilePrefix ...string) error
- func CreateTmpDir() error
- func DetectArch() error
- func DetectOS() error
- func DownloadAndExecScript(scriptUrl string, scriptPars ...string) error
- func DownloadToTmpDir(urlTemplate string, pars ...any) (string, error)
- func ErrorPrintf(format string, pars ...any)
- func ExecShellCmd(cmd string, pars ...any) (string, error)
- func ExecVHiveBashScript(scriptRelativePath string, scriptPars ...string) (string, error)
- func ExtractToDir(archiveFilePath string, dirPath string, privileged bool) error
- func FatalPrintf(format string, pars ...any)
- func GetCurrentDir() error
- func GetEnvironmentVariable(variableNameTemplate string, pars ...any) string
- func GetKernelArch() (string, error)
- func GetKernelVersion() (string, error)
- func GetUserHomeDir() error
- func GetVHiveFilePath(fileRelativePath string) (string, error)
- func InfoPrintf(format string, pars ...any)
- func InstallPackages(packagesTemplate string, pars ...any) error
- func PrepareEnvironment() error
- func PrintWarningInfo()
- func SuccessPrintf(format string, pars ...any)
- func TurnOffAutomaticUpgrade() error
- func UpdateEnvironmentVariable(variableName string, newValueTemplate string, pars ...any) (string, error)
- func WaitPrintf(format string, pars ...any)
- func WarnPrintf(format string, pars ...any)
- func WriteToSysctl(sysConfigTemplate string, pars ...any) error
- type ShellError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AppendDirToPath ¶
Append directory to PATH variable for bash & zsh
func AppendDirToPathVariable ¶
Append directory to current PATH variable
func CheckErrorWithMsg ¶
If err is not nil, print the error message, send it to the error logs, and return false Otherwise, do nothing and return true
func CheckErrorWithTagAndMsg ¶
If err is not nil, print the error message, send it to the error logs, and return false Otherwise, print a success tag, and return true
func CheckVHiveRepo ¶
func CheckVHiveRepo() error
Check whether vHive repo exists, if not, clone it to the temporary directory
func CloneRepoToTmpDir ¶
Clone git repo to temporary directory (absolute path of cloned repo will be the first return value if successful)
func DownloadAndExecScript ¶
Download and execute remote bash script
func DownloadToTmpDir ¶
Download file to temporary directory (absolute path of downloaded file will be the first return value if successful)
func ErrorPrintf ¶
Print error message (red) in terminal and send it to the error logs(if exist)
func ExecShellCmd ¶
Execute Shell Command
func ExecVHiveBashScript ¶
Execute bash scripts from vHive repo
func ExtractToDir ¶
Extract archive file to specific directory(currently support .tar.gz, .gz, .tgz, .zip file only)
func GetEnvironmentVariable ¶
Get the value of specific environment variable
func GetKernelArch ¶
Get kernel arch info (equivalent to `uname -m`)
func GetKernelVersion ¶
Get kernel version info (equivalent to `uname -r`)
func GetVHiveFilePath ¶
Get absolute path of the file in vHive repo(given the relative path)
func InfoPrintf ¶
Print information (blue) in terminal and send it to the common logs(if exist)
func InstallPackages ¶
Install packages on various OS
func SuccessPrintf ¶
Print success message (green) in terminal and send it to the common logs(if exist)
func UpdateEnvironmentVariable ¶
func UpdateEnvironmentVariable(variableName string, newValueTemplate string, pars ...any) (string, error)
Update the value of specific environment variable
func WaitPrintf ¶
Print information (blue) with waiting symbol in terminal and send it to the common logs(if exist)
func WarnPrintf ¶
Print warning message (yellow) in terminal and send it to the common logs(if exist)
func WriteToSysctl ¶
Write to sysctl.conf
Types ¶
type ShellError ¶
Implement error interface of ShellError
func (*ShellError) Error ¶
func (err *ShellError) Error() string