Documentation
¶
Overview ¶
Package update checks whether a newer netscope release is available on GitHub and reports it to the UI. The actual download+swap is handled by the GUI app (desktop/updates_darwin.go), which restarts the daemon over its unix socket after replacing the bundle — no admin prompt needed.
SHA-256 verification of downloaded release assets against the release's checksums.txt (produced by CI at package time, shasum -a 256 format).
Index ¶
Constants ¶
const ChecksumAsset = "checksums.txt"
ChecksumAsset is the release asset holding SHA-256 sums of the other assets (one "hex filename" line each, shasum -a 256 format).
Variables ¶
This section is empty.
Functions ¶
func FindChecksum ¶ added in v0.17.0
FindChecksum extracts the SHA-256 hex digest for the named file from a checksums.txt body. Lines look like "<64-hex> <name>" (shasum also emits a "*<name>" binary-mode marker, which is accepted). Returns ok=false when the file has no entry.
func Newer ¶
Newer reports whether version `latest` is strictly greater than `current` under semver (ignoring a leading "v" and any pre-release suffix). If either side is not parseable (e.g. a "dev" build), it returns false so we never nag.
func VerifyFileSHA256 ¶ added in v0.17.0
VerifyFileSHA256 hashes the file at path and compares it to the expected hex digest, returning a descriptive error on mismatch.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker periodically refreshes and caches an update Status.
func NewChecker ¶
NewChecker builds a Checker. interval bounds how often GitHub is queried.
type Status ¶
type Status struct {
Current string `json:"current"`
Latest string `json:"latest"`
UpdateAvailable bool `json:"updateAvailable"`
URL string `json:"url"` // release page (human-facing)
AssetURL string `json:"assetUrl"` // app .zip download (in-app self-update)
ChecksumURL string `json:"checksumUrl"` // checksums.txt with the zip's SHA-256
CheckedAt time.Time `json:"checkedAt"`
}
Status is the cached result of an update check.