Documentation
¶
Overview ¶
Package update implements self-update for evva.
It fetches the latest GitHub Release, compares versions, downloads the correct binary asset for the current OS/arch, and replaces the running binary atomically — no Go toolchain required.
Index ¶
Constants ¶
const ( DefaultOwner = "johnny1110" DefaultRepo = "evva" )
defaults for the bundled evva binary.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply downloads the appropriate asset for the current OS/arch from the release, decompresses it, and replaces the currently running binary. Returns the path to the replaced binary.
On Unix the replacement is atomic (os.Rename on the same filesystem). On Windows the replacement is deferred to next launch (the running exe cannot be overwritten).
func CurrentVersion ¶
func CurrentVersion() string
CurrentVersion returns the ldflags-injected version string. Falls back to the compile-time default when ldflags weren't set (dev builds, go run).
Types ¶
type Asset ¶
type Asset struct {
Name string // e.g. "evva-darwin-arm64.tar.gz"
DownloadURL string // browser_download_url
Size int64 // bytes
}
Asset is a single downloadable file attached to a release.
type Release ¶
type Release struct {
Version string // tag name, e.g. "v0.2.0"
URL string // HTML URL of the release page
Assets []Asset // downloadable assets
}
Release represents a GitHub Release with its downloadable assets.