Documentation ¶
Index ¶
- func DownloadFileToTemp(url string, headers *map[string]string) (string, error)
- func Extract(file string) (string, error)
- func GetBinFromDir(dir string) (string, error)
- func HumanSize(size int64) string
- func InstallBin(src string, binName string, binDir string) error
- func IsCompressedFile(file string) bool
- func IsExecutable(file string) bool
- func IsQualifiedAsset(name string) bool
- func PathExists(path string) bool
- func Request(url string, headers *map[string]string) ([]byte, error)
- func ShowSpinnerWhile(message string) func()
- type File
- type GitHub
- type GitHubRelease
- type GithubReleaseAsset
- type InstallOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFileToTemp ¶
DownloadFileToTemp download url to a temporary file and returns the path to the temporary file
func GetBinFromDir ¶
func IsCompressedFile ¶
Check if file ends with any of the extensions
func IsExecutable ¶
func IsQualifiedAsset ¶
func PathExists ¶
func ShowSpinnerWhile ¶
func ShowSpinnerWhile(message string) func()
Types ¶
type GitHub ¶
func (*GitHub) DownloadAndInstallAsset ¶
func (gh *GitHub) DownloadAndInstallAsset(asset *GithubReleaseAsset, installOpts *InstallOpts) error
func (*GitHub) FetchRelease ¶
func (gh *GitHub) FetchRelease() (GitHubRelease, error)
func (*GitHub) GetHeaders ¶
type GitHubRelease ¶
type GitHubRelease struct { TagName string `json:"tag_name"` Assets []GithubReleaseAsset `json:"assets"` }
type GithubReleaseAsset ¶
type InstallOpts ¶
Click to show internal directories.
Click to hide internal directories.