Documentation
¶
Overview ¶
Package updater is SSHYard's update client. Releases are published as MyGo publishes them on GitHub Releases: a signed archive per platform with a manifest, update-<os>-<arch>.json, in the latest release of Licoy/sshyard. Installing goes through mygo.Updater, which checks the Ed25519 signature against the public key built into the app.
Index ¶
Constants ¶
const MaxManifestSize = 1 << 20
MaxManifestSize bounds a manifest read from the network.
const Repo = "Licoy/sshyard"
Repo is the GitHub repository SSHYard's releases are published in.
Variables ¶
This section is empty.
Functions ¶
func ManifestName ¶
ManifestName is the manifest's file name for a platform.
func ManifestURL ¶
ManifestURL is where the latest release's manifest of a platform is.
func Plugin ¶
Plugin is MyGo's updater plugin drawn in native UI, which reads the manifest `mygo build` publishes to the latest release of the repository in mygo.json (updates.github = Licoy/sshyard) and verifies signatures. It checks soon after each launch and every interval after while automatic is on. The interval is read once: a change applies at the next launch.
Types ¶
type Backend ¶
type Backend interface {
// Enabled reports whether this build can update itself: development
// builds and those installed by a package manager cannot.
Enabled() bool
// Check checks as the user asked: the update window shows at once and
// says what it found.
Check()
// SetAutomatic turns the checks in the background on or off.
SetAutomatic(on bool)
// Available is the newer version the last check found, or "".
Available() string
// OnChange calls fn on the main thread after Available may have
// changed, and returns a function that removes it.
OnChange(fn func()) (off func())
}
Backend is the update window of the app: MyGo's updater plugin, which checks soon after launch and every interval after, shows the release notes of a newer version in its own window and installs it; a fake in tests.
type Delta ¶
type Delta struct {
From string `json:"from"`
URL string `json:"url"`
Size int64 `json:"size"`
Signature string `json:"signature"`
}
Delta is a delta update from an earlier version.
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
Notes string `json:"notes,omitempty"`
Date string `json:"date,omitempty"`
URL string `json:"url"`
Size int64 `json:"size"`
Signature string `json:"signature"`
Deltas []Delta `json:"deltas,omitempty"`
}
Manifest is MyGo's update manifest, update-<os>-<arch>.json.
func ParseManifest ¶
ParseManifest reads and checks a manifest.
type MygoBackend ¶
type MygoBackend struct{}
MygoBackend is the Backend of the app, over the plugin Plugin returns, which must be used.
func (MygoBackend) Available ¶
func (MygoBackend) Available() string
func (MygoBackend) Check ¶
func (MygoBackend) Check()
func (MygoBackend) Enabled ¶
func (MygoBackend) Enabled() bool
func (MygoBackend) OnChange ¶
func (MygoBackend) OnChange(fn func()) (off func())
func (MygoBackend) SetAutomatic ¶
func (MygoBackend) SetAutomatic(on bool)
type Version ¶
Version is a semantic version: major.minor.patch with an optional prerelease; build metadata is ignored.
func ParseVersion ¶
ParseVersion parses "1.2.3", "v1.2.3-beta.1" or "1.2.3+build".
func (Version) Prerelease ¶
Prerelease reports whether the version is a prerelease.