updatecheck

package
v1.0.86 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package updatecheck looks up the latest RelSpec release on the project's Gitea instance and compares it against the running version.

Index

Constants

View Source
const DefaultAPIURL = "https://git.warky.dev/api/v1/repos/wdevs/relspecgo/releases/latest"

DefaultAPIURL is the Gitea endpoint that returns the latest release.

Variables

This section is empty.

Functions

func IsNewer

func IsNewer(current, latest string) bool

IsNewer reports whether latest is a higher version than current. Versions that are not dotted numbers (for example "dev" or a commit hash) are never considered outdated, so development builds are not nagged.

Types

type Asset

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

Asset is a downloadable file attached to a release.

type Release

type Release struct {
	Tag    string  `json:"tag_name"`
	URL    string  `json:"html_url"`
	Assets []Asset `json:"assets"`
}

Release is the subset of the Gitea release payload that is needed.

func Latest

func Latest(ctx context.Context, client *http.Client, apiURL string) (*Release, error)

Latest fetches the latest release from apiURL. A nil client uses a client with a 10 second timeout.

func (*Release) FindAsset

func (r *Release) FindAsset(name string) (Asset, bool)

FindAsset returns the first asset with the given name.

Jump to

Keyboard shortcuts

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