Documentation
¶
Index ¶
- func CheckIfExecutable(filepath string) bool
- func DownloadFile(url string, filepath string, size int64) error
- func GetDefaultInstallPath() (string, error)
- func GetExpectedChecksum(checksumsAsset *Asset, binaryName string) (string, error)
- func MakeExecutable(filepath string) error
- func VerifyChecksum(filepath string, expectedChecksum string) (bool, error)
- type Asset
- type InstallOptions
- type Platform
- type Release
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfExecutable ¶
CheckIfExecutable checks if a file exists and is executable
func DownloadFile ¶
DownloadFile downloads a file from the given URL with a progress bar
func GetDefaultInstallPath ¶
GetDefaultInstallPath returns the default installation path for the current OS
func GetExpectedChecksum ¶
GetExpectedChecksum fetches and parses the checksums.txt to get the expected checksum
func MakeExecutable ¶
MakeExecutable makes a file executable on Unix-like systems
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
}
Asset represents a release asset
func GetBinaryAsset ¶
GetBinaryAsset finds the appropriate binary asset for the current platform
func GetChecksumsAsset ¶
GetChecksumsAsset finds the checksums.txt asset
type InstallOptions ¶
type InstallOptions struct {
Version string // Specific version to install (e.g., "v0.1.3"), empty for latest
InstallPath string // Where to install the binary
Force bool // Force reinstall even if already exists
}
InstallOptions holds installation options
type Platform ¶
Platform represents the current platform information
func GetCurrentPlatform ¶
func GetCurrentPlatform() Platform
GetCurrentPlatform returns the current platform information