Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions compares two semver versions Returns: -1 if v1 < v2, 0 if v1 == v2, 1 if v1 > v2
func DownloadAndReplace ¶
func DownloadAndReplace(ctx context.Context, asset *Asset, progress ProgressCallback) error
DownloadAndReplace downloads a new binary and replaces the current one
func VerifyChecksum ¶
VerifyChecksum verifies the SHA256 checksum of a file
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
ContentType string `json:"content_type"`
}
Asset represents a release asset
type ProgressCallback ¶
type ProgressCallback func(downloaded, total int64)
ProgressCallback is called to report download progress
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
Body string `json:"body"`
HTMLURL string `json:"html_url"`
PublishedAt time.Time `json:"published_at"`
Assets []Asset `json:"assets"`
}
Release represents a GitHub release
func GetLatestRelease ¶
GetLatestRelease fetches the latest release from GitHub
func (*Release) GetAssetForPlatform ¶
GetAssetForPlatform returns the download asset for the current platform
func (*Release) GetVersion ¶
GetVersion extracts the version from a tag name (e.g., "v1.2.3" -> "1.2.3")
Click to show internal directories.
Click to hide internal directories.