updater

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package updater discovers release updates and verifies/install binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseVersion

func BaseVersion(v string) string

func Install

func Install(executable string, data []byte) error

Install writes a candidate next to the real executable before replacing it. Unix replacement is atomic. Windows keeps a rollback copy through the swap.

func Newer

func Newer(current, latest string) bool

Types

type Asset

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

type Client

type Client struct {
	HTTP *http.Client
	API  string
	Repo string
	OS   string
	Arch string
}

func New

func New() *Client

func (*Client) Check

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

func (*Client) Download

func (c *Client) Download(ctx context.Context, r Release) ([]byte, error)

func (*Client) Notice

func (c *Client) Notice(ctx context.Context, current string) <-chan Release

Notice performs an opportunistic daily release check. It never delays a command or installs anything. Failure to contact GitHub is silent.

type Release

type Release struct {
	Tag        string  `json:"tag_name"`
	URL        string  `json:"html_url"`
	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