utils

package
v0.0.0-...-465f591 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSignals

func ClearSignals(sgn chan os.Signal)

func CopyFile

func CopyFile(src, dst string) error

func DoesFileExists

func DoesFileExists(name string) (bool, error)

func DownloadToFile

func DownloadToFile(downloadURL, filePath string) error

func ExtractTarGzFile

func ExtractTarGzFile(sourceFile, target string) error

func GetAbsolutePath

func GetAbsolutePath(relativePath string) string

func GetDaysSinceRFC3339String

func GetDaysSinceRFC3339String(date string) (int, error)

func GetLatestReleaseFromGitHub

func GetLatestReleaseFromGitHub(repoName string) (*gitHubReleaseType, error)

func GetPathToCurrentBinary

func GetPathToCurrentBinary() (string, error)

func HasWritePermissionToFile

func HasWritePermissionToFile(filePath string) (bool, error)

func OpenURLInBrowser

func OpenURLInBrowser(url string)

func RenderProgressSpinnerWithMessages

func RenderProgressSpinnerWithMessages(complete, quit chan bool, loadMessages, afterLoadMessages []string)

func RunOnCtrlC

func RunOnCtrlC(cleanupFn func()) chan os.Signal

func SafeMoveFile

func SafeMoveFile(source, target string, showLogs bool) (err error)

func ShowConfirmationPrompt

func ShowConfirmationPrompt(msg string) (bool, error)

func VerifyLicenseJSON

func VerifyLicenseJSON(pathToFile string) error

func WaitAndOpenURL

func WaitAndOpenURL(url string, sgn chan bool, interval int)

func WaitForResponsiveURL

func WaitForResponsiveURL(url string, intervalSeconds int)

Ignores all error and waits for URL to be responsive by sending HEAD request every intervalSeconds

Types

type LicenseFileType

type LicenseFileType struct {
	PrivateKey string `json:"pri_key"`
	UserHash   string `json:"user_hash"`
}

Jump to

Keyboard shortcuts

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