upgrade

package
v1.28.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package upgrade replaces the gtt binary with another release. It is an adapter: it knows how each install channel (npm, uv, pipx, go install, the curl and PowerShell installers) puts the binary on the machine and how to take the next one from the release assets, verified, with a way back. It knows nothing of projects.

Index

Constants

View Source
const Repo = "GTT-Community/gtt-cli"

Repo is the only repository releases are taken from, unless the human declares a mirror.

Variables

This section is empty.

Functions

func Channel

func Channel(exe string, goBins []string) string

Channel names how this binary got onto the machine, from where it lives.

Types

type Upgrader

type Upgrader struct {
	Runner ports.Runner
	// Base is the mirror holding the release assets (GTT_DOWNLOAD_BASE); empty means GitHub releases.
	Base string
	// Exe is the binary being replaced; empty means the running one.
	Exe string
	// HTTP is the client; nil means a default one with timeouts.
	HTTP *http.Client
	// GOOS and GOARCH override the platform (tests); empty means this machine.
	GOOS, GOARCH string
	// GoBins are the directories `go install` writes to (GOBIN, GOPATH/bin); empty means read the environment.
	GoBins []string
}

Upgrader implements ports.SelfUpgrader.

func (*Upgrader) Apply

func (u *Upgrader) Apply(ctx context.Context, plan ports.UpgradePlan) error

Apply runs the package manager command, or replaces the binary itself.

func (*Upgrader) Latest

func (u *Upgrader) Latest(ctx context.Context) (string, error)

Latest asks GitHub which release "latest" points to; with a mirror, the mirror's VERSION file says it.

func (*Upgrader) Plan

func (u *Upgrader) Plan(target string) ports.UpgradePlan

Plan decides, from where the running binary lives, how it would be replaced.

Jump to

Keyboard shortcuts

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