Documentation
¶
Index ¶
- Variables
- func Apply(ctx context.Context, url string) error
- func ApplyTo(ctx context.Context, rawURL, exe string) error
- func CleanupOld()
- func ExecutablePath() (string, error)
- func HandleRestartHelper(args []string) (handled bool, code int)
- func Restart(exe string) error
- func TrustedComment(tag string) string
- func VerifySums(sums, sig []byte, tag string) error
- func VerifySumsWith(keys []minisign.PublicKey, sums, sig []byte, tag string) error
- type Release
Constants ¶
This section is empty.
Variables ¶
var ErrNotNewer = errors.New("installed version is already up to date")
ErrNotNewer means the installed binary is already at or past the release: another updater ran after this release was checked.
Functions ¶
func Apply ¶
Apply downloads the binary from url, verifies it, and replaces the currently running executable. The caller should restart after Apply returns.
func CleanupOld ¶
func CleanupOld()
CleanupOld removes leftover .old files from a previous update (Windows).
func ExecutablePath ¶
func HandleRestartHelper ¶
HandleRestartHelper runs the hidden restart helper command. It returns handled=false when args do not name the helper command.
func Restart ¶
Restart launches a detached helper from the updated binary and returns. The helper starts the replacement tray after the current process exits, so the desktop tray watcher sees a clean unregister/register sequence.
func TrustedComment ¶ added in v0.40.0
TrustedComment is the signed comment a release signature must carry. Binding the tag stops an old signed release being replayed under a new tag.
func VerifySums ¶ added in v0.40.0
VerifySums checks that sig is a valid signature over sums by a trusted key and that its signed comment names tag. The key is chosen by the key ID in the signature; an unknown ID fails.