upgrade

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackageManagerCommand

func PackageManagerCommand(executablePath string) []string

Types

type Asset

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

type Check

type Check struct {
	Current   string `json:"current"`
	Latest    string `json:"latest,omitempty"`
	Available bool   `json:"available"`
}

type Client

type Client struct {
	HTTPClient  *http.Client
	ReleasesURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (*Client) Check

func (c *Client) Check(ctx context.Context, current string) (Check, error)

func (*Client) InstallLatest

func (c *Client) InstallLatest(ctx context.Context, current, executablePath, publicKey string) (InstallResult, error)

func (*Client) Latest

func (c *Client) Latest(ctx context.Context, current string) (Release, error)

Latest returns the highest SemVer release in the current binary's channel. GitHub's prerelease flag is authoritative because preview v0 tags do not necessarily contain a SemVer prerelease suffix.

type InstallResult

type InstallResult struct {
	Current       string   `json:"current"`
	Installed     string   `json:"installed"`
	Executable    string   `json:"executable,omitempty"`
	AlreadyLatest bool     `json:"already_latest,omitempty"`
	Delegated     bool     `json:"delegated,omitempty"`
	Command       []string `json:"command,omitempty"`
}

func (InstallResult) HumanText

func (r InstallResult) HumanText() string

type Release

type Release struct {
	TagName    string  `json:"tag_name"`
	Draft      bool    `json:"draft"`
	Prerelease bool    `json:"prerelease"`
	Assets     []Asset `json:"assets"`
}

Jump to

Keyboard shortcuts

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