update

package
v0.8.21 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 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 update checks GitHub Releases for a newer Velo, downloads its installer and verifies it before running it.

A release is tagged vX.Y.Z and has an asset named Velo-Setup-X.Y.Z.exe. The download must match a SHA-256 checksum: GitHub's own asset digest when available, otherwise a Velo-Setup-X.Y.Z.exe.sha256 asset next to it.

Index

Constants

View Source
const MaxSize = 300 << 20

MaxSize is the largest installer accepted.

Variables

View Source
var (
	Attempts     = 6
	StallTimeout = 60 * time.Second
)

Attempts and StallTimeout bound an update download.

View Source
var API = "https://api.github.com/repos/Adoxcol/velo/releases/latest"

API is the "latest release" endpoint (changed in tests).

View Source
var ErrNoRelease = errors.New("no published release found")

ErrNoRelease means the repository has no published release (or is private).

Functions

func Download

func Download(ctx context.Context, client *http.Client, rel *Release, dir string) (string, error)

Download saves the installer into dir and checks its SHA-256. A slow or unsteady connection is fine: each attempt continues the partial file from where the last one stopped, and an attempt only gives up when no data arrives for StallTimeout.

func Install

func Install(path string) error

Install starts the verified installer silently; it closes Velo, replaces it and starts the new version.

func Newer

func Newer(a, b string) bool

Newer reports whether version a is newer than b ("dev" is never newer and never updated).

Types

type Release

type Release struct {
	Version string `json:"version"`
	URL     string `json:"url"`    // installer download
	SHA256  string `json:"sha256"` // expected checksum, hex
	SumURL  string `json:"sum_url,omitempty"`
	Page    string `json:"page"` // release notes page
	Notes   string `json:"notes"`
}

func Latest

func Latest(ctx context.Context, client *http.Client) (*Release, error)

Latest returns the newest published release.

Jump to

Keyboard shortcuts

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