updater

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 10 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package updater keeps an app up to date the way its platform does. On macOS and Windows, Sparkle and WinSparkle, which nsgo build bundles when nsgo.yaml configures updates, read the app's appcast on their own schedule, download a newer release, verify its EdDSA signature, install it and restart the app. Linux and Android read the same appcast, verify and install its package after the user confirms, and iOS asks the App Store, once a day and whenever the user asks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(cx *core.Scope)

Check checks for a newer version now, as a Check for Updates… item does, and shows what it finds: on macOS and Windows in Sparkle's and WinSparkle's windows, on Linux and Android an alert that installs the signed package after confirmation, elsewhere an alert that offers to open the newer version's page, says the app is up to date, or says the check failed.

func CheckDaily

func CheckDaily(cx *core.Scope)

CheckDaily checks in the background, as CheckInBackground does, unless it has within the last day, so a newer version is offered once a day rather than at every start. Sparkle and WinSparkle keep such a schedule of their own; on Linux, Android and iOS nsgo.Run calls CheckDaily as the app starts and as the user comes back to it when nsgo.yaml's updates.automatic is on. A check that failed, as one offline does, is tried again an hour later.

func CheckInBackground

func CheckInBackground(cx *core.Scope)

CheckInBackground checks without showing anything unless it finds a newer version, as the platforms' scheduled checks do.

func Download

func Download(ctx context.Context, update core.UpdateCheck, dir string, progress func(DownloadProgress)) (string, error)

Download fetches an update's signed package into dir. It verifies the appcast's SHA-256 and Ed25519 metadata before making the file visible, so an interrupted or tampered download cannot be installed.

func Install

func Install(cx *core.Scope, path string, done func(error))

Install downloads' verified package through the platform's installer. Linux asks its package manager for elevation; Android opens the package installer. The callback runs on the app's graph goroutine.

Types

type DownloadProgress

type DownloadProgress struct {
	Loaded, Total int64
}

DownloadProgress reports bytes written while an update is downloaded.

Directories

Path Synopsis
Package locales says the updater's words: its alerts where the platform's updater has no windows of its own.
Package locales says the updater's words: its alerts where the platform's updater has no windows of its own.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL