Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions compares two semantic version strings. Returns:
-1 if current < latest (update available) 0 if current == latest (up to date) 1 if current > latest (ahead of latest, e.g., dev build)
Handles versions with or without "v" prefix (v1.2.3 or 1.2.3)
func GetLatestVersion ¶
GetLatestVersion fetches the latest release version from GitHub API. It returns the version tag (e.g., "v1.2.3") and any error encountered.
func IsConnectedToInternet ¶
func IsConnectedToInternet() bool
IsConnectedToInternet performs a quick check to see if the user has internet connectivity. It tries to resolve a reliable DNS name (GitHub's) with a short timeout.
Types ¶
type ReleaseInfo ¶
type ReleaseInfo struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
HTMLURL string `json:"html_url"`
}
ReleaseInfo represents the GitHub release information
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string
LatestVersion string
UpdateURL string
HasUpdate bool
}
UpdateInfo contains information about available updates
func CheckForUpdate ¶
func CheckForUpdate(currentVersion string) (*UpdateInfo, error)
CheckForUpdate checks if a newer version is available. It first verifies internet connectivity, then fetches the latest version from GitHub. Returns UpdateInfo with details about the update, or an error if the check fails.