update

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package update provides self-update functionality using GitHub releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Release

type Release struct {
	Version string `json:"version"`
	URL     string `json:"url"`
}

Release describes a GitHub release with the download URL for the current platform.

type Updater

type Updater struct {
	CurrentVersion string
	RepoOwner      string
	RepoName       string
	// contains filtered or unexported fields
}

Updater checks for and applies self-updates from GitHub releases.

func New

func New(currentVersion string) *Updater

New returns an Updater configured for the GoCodeAlone/ratchet repository.

func (*Updater) ApplyUpdate

func (u *Updater) ApplyUpdate(release *Release) error

ApplyUpdate downloads the release binary and replaces the running executable.

func (*Updater) CheckForUpdate

func (u *Updater) CheckForUpdate() (*Release, error)

CheckForUpdate queries the GitHub releases API for the latest release. Returns nil, nil when already on the latest version.

Jump to

Keyboard shortcuts

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