updatecheck

package
v0.153.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 15 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 updatecheck looks for a newer gofer release (gofer-6x2n, docs/design/2026-10-13-update-check-design.md): the latest GitHub release by default, or a mirror's latest.yaml. It only reports; it never downloads or installs anything.

Index

Constants

View Source
const AppName = "gofer"

AppName is the {name} of the release artifacts.

Variables

This section is empty.

Functions

func Newer

func Newer(latest, current string) bool

Newer reports whether latest is a newer release than current. Versions compare as X.Y.Z numbers; a development build of current ("0.152.3-2-gabc", "-dirty") counts as past its base release, so an equal base is not "newer". An unparsable version never reports newer.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker checks one source and keeps the latest result.

func New

func New(current string, cfg func() config.UpdateConfig) *Checker

New builds a checker for the running version; cfg is read on every check, so a reload applies to the next one.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context) Status

Check runs one check now and returns (and keeps) its result. A failure is in Status.Error, never fatal.

func (*Checker) Run

func (c *Checker) Run(ctx context.Context)

Run checks after firstCheckDelay and then every interval until ctx ends; a disabled config skips the periodic checks (and is re-read each time).

func (*Checker) Status

func (c *Checker) Status() Status

Status returns the latest result (CheckedAt 0 = never checked).

type Status

type Status struct {
	Current     string `json:"current"`
	Latest      string `json:"latest,omitempty"`
	Newer       bool   `json:"newer"`
	Source      string `json:"source"`
	CheckedAt   int64  `json:"checked_at"`
	ReleasedAt  string `json:"released_at,omitempty"`
	ReleaseURL  string `json:"release_url,omitempty"`
	DownloadURL string `json:"download_url,omitempty"`
	Description string `json:"description,omitempty"`
	Error       string `json:"error,omitempty"`
}

Status is the result of the latest check.

Jump to

Keyboard shortcuts

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