upgrade

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package upgrade implements self-update from GitHub releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Upgrade

func Upgrade(current string, progress func(msg string)) (string, error)

Upgrade downloads and installs the latest release, replacing the running binary. It returns the new version tag on success.

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	Size               int64  `json:"size"`
}

Asset is a single file attached to a GitHub release.

type CheckResult

type CheckResult struct {
	Current         string
	Latest          string
	UpdateAvailable bool
	Release         *Release
}

CheckResult is the result of a version check.

func Check

func Check(current string) (*CheckResult, error)

Check compares current against the latest GitHub release tag and returns a CheckResult describing whether an update is available.

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Name    string  `json:"name"`
	Assets  []Asset `json:"assets"`
}

Release represents a GitHub release response (subset of fields used).

func FetchLatestRelease

func FetchLatestRelease() (*Release, error)

FetchLatestRelease queries the GitHub releases API for the latest release.

Jump to

Keyboard shortcuts

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