Documentation
¶
Overview ¶
Package version provides functionality for checking for Surge updates via GitHub API.
Index ¶
Constants ¶
View Source
const ( // GitHubAPIURL is the endpoint for fetching the latest release GitHubAPIURL = "https://api.github.com/repos/SurgeDM/Surge/releases/latest" // RequestTimeout is the timeout for the GitHub API request RequestTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitHubRelease ¶
GitHubRelease represents the relevant fields from the GitHub API response
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string // The current version of Surge
LatestVersion string // The latest version available on GitHub
ReleaseURL string // URL to the GitHub release page
UpdateAvailable bool // Whether an update is available
}
UpdateInfo contains information about an available update
func CheckForUpdate ¶
func CheckForUpdate(currentVersion string) (*UpdateInfo, error)
CheckForUpdate checks if a newer version of Surge is available on GitHub. Returns nil, nil if there's a network error (fail silently). Returns UpdateInfo with UpdateAvailable=false if current version is up to date. Returns UpdateInfo with UpdateAvailable=true if a newer version exists.
Click to show internal directories.
Click to hide internal directories.