updates

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 10 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 updates asks GitHub for the latest Buggregator server release so the UI can say that a new version is out.

One GET of releases/latest at start and then every interval (12 h by default); a failed check waits an hour, never less. The check is optional: it never blocks start, only logs at debug level, and makes no network call when switched off or when the running build has no release version (dev).

Index

Constants

View Source
const (
	DefaultInterval = 12 * time.Hour
)
View Source
const LatestURL = "https://api.github.com/repos/buggregator/server/releases/latest"

LatestURL is the GitHub API for the newest published (non-draft, non-prerelease) server release.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker keeps the result of the last successful check.

func New

func New(current string, interval time.Duration) *Checker

New returns a checker for the running version. interval <= 0 means the default; anything below an hour is raised to an hour.

func (*Checker) Run

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

Run checks at once and then on schedule until ctx ends. A build without a release version (dev) never checks.

func (*Checker) Status

func (c *Checker) Status() Status

Status returns the last known result.

type Status

type Status struct {
	Current   string     `json:"current"`
	Latest    string     `json:"latest,omitempty"`     // newest release, without a leading v
	URL       string     `json:"url,omitempty"`        // its release page
	Available bool       `json:"available"`            // Latest is newer than Current
	CheckedAt *time.Time `json:"checked_at,omitempty"` // last successful check
}

Status is what the UI reads.

Jump to

Keyboard shortcuts

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