Documentation
¶
Overview ¶
Package selfupdate downloads and installs javaup releases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressEvent ¶ added in v0.4.0
type ProgressEvent struct {
Stage ProgressStage
Current string
Latest string
Name string
URL string
Downloaded int64
Total int64
}
ProgressEvent describes one observable point in the self-update process.
type ProgressFunc ¶ added in v0.4.0
type ProgressFunc func(ProgressEvent)
ProgressFunc receives self-update progress events.
type ProgressStage ¶ added in v0.4.0
type ProgressStage string
ProgressStage identifies a visible phase of the self-update process.
const ( // ProgressChecking reports that the latest release is being queried. ProgressChecking ProgressStage = "checking" // ProgressAvailable reports the version transition that will be installed. ProgressAvailable ProgressStage = "available" // ProgressFetchingChecksums reports that the release checksum list is being fetched. ProgressFetchingChecksums ProgressStage = "fetching-checksums" // ProgressConnecting reports that the release archive request is being established. ProgressConnecting ProgressStage = "connecting" // ProgressDownloading reports release archive download progress. ProgressDownloading ProgressStage = "downloading" // ProgressVerifying reports that the release checksum is being verified. ProgressVerifying ProgressStage = "verifying" // ProgressExtracting reports that the release executable is being extracted. ProgressExtracting ProgressStage = "extracting" // ProgressInstalling reports that the downloaded release is being installed. ProgressInstalling ProgressStage = "installing" )
type Updater ¶
type Updater struct {
CurrentVersion string
HTTPClient *http.Client
APIBase string
ReleaseBase string
GOOS string
GOARCH string
ExecutablePath string
// contains filtered or unexported fields
}
Updater checks GitHub Releases and replaces the current executable.
func (*Updater) Update ¶
Update downloads, verifies, and installs the latest release when it is newer.
func (*Updater) UpdateWithProgress ¶ added in v0.4.0
UpdateWithProgress downloads, verifies, and installs the latest release while reporting progress.
Click to show internal directories.
Click to hide internal directories.