Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
}
Asset is a single file attached to a GitHub release.
type Option ¶
type Option func(*Updater)
Option configures an Updater.
func WithLatestURL ¶
WithLatestURL overrides the GitHub Releases API endpoint. Intended for tests.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater checks for and performs heraut self-updates.
func New ¶
New constructs an Updater. currentVersion should be the build-time version (e.g. "v1.2.3" or "dev"). Use WithLatestURL to override the API endpoint in tests.
func (*Updater) Check ¶
Check fetches the latest release and returns (latestTag, updateAvailable, error). It always fetches — it does not use the 24 h cache.
func (*Updater) Do ¶
Do performs the full self-update: fetch → find asset → download → verify SHA-256 → chmod → atomic replace.