Documentation
¶
Overview ¶
Package version provides non-blocking version checking against GitHub releases.
Index ¶
Constants ¶
const ( // BashInstallScriptURL is the official Bash installer for macOS, Linux, and Windows Bash environments. BashInstallScriptURL = "https://raw.githubusercontent.com/microsoft/waza/main/install.sh" // PowerShellInstallScriptURL is the official PowerShell installer for native Windows environments. PowerShellInstallScriptURL = "https://raw.githubusercontent.com/microsoft/waza/main/install.ps1" // InstallScriptURL is the default Unix-like installer URL retained for existing callers. InstallScriptURL = BashInstallScriptURL // DefaultUpdateCommand is the recommended command for upgrading waza. DefaultUpdateCommand = "waza update" )
Variables ¶
This section is empty.
Functions ¶
func PrintNotice ¶
func PrintNotice(result *CheckResult, installCmd string) bool
PrintNotice prints an upgrade notice to stderr if a newer version is available. Returns true if a notice was printed.
Types ¶
type CheckResult ¶
CheckResult holds the outcome of a version comparison.
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker performs async version checks against GitHub releases.
func NewChecker ¶
NewChecker creates a version checker for the given current version.
func (*Checker) Result ¶
func (c *Checker) Result() *CheckResult
Result returns the check result. It blocks briefly (up to 100ms) for the background check to complete. Returns nil if the check has not finished, the current version is not parseable, or an error occurred.
type Option ¶
type Option func(*Checker)
Option configures a Checker.
func WithAPIBaseURL ¶
WithAPIBaseURL overrides the GitHub API base URL (for testing).
func WithCacheDir ¶
WithCacheDir overrides the default cache directory.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client (useful for testing).