update

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comparable added in v0.10.1

func Comparable(ver string) bool

Comparable reports whether ver is a release version advisories can be matched against. Development builds are not, so "no advisories match" says nothing about them.

func UpgradeHint added in v0.10.1

func UpgradeHint() string

UpgradeHint is the command that upgrades the running binary, chosen by where it is installed; a link to the update docs when that is unknown.

Types

type Advisory added in v0.10.1

type Advisory struct {
	ID       string `json:"id"`
	Summary  string `json:"summary"`
	Severity string `json:"severity"`
	URL      string `json:"url"`
	// Range is the vulnerable version range in GitHub's syntax, e.g.
	// "< 0.9.5" or ">= 0.4.0, < 0.6.5".
	Range string `json:"range"`
	// Patched is the first fixed version, empty when none is published.
	Patched string `json:"patched,omitempty"`
}

Advisory is a published security advisory affecting the melange module.

func Affecting added in v0.10.1

func Affecting(advisories []Advisory, ver string) []Advisory

Affecting returns the advisories whose vulnerable range contains ver, once per advisory ID. An empty or development version matches nothing: there is no release to compare it with.

func (Advisory) FixedIn added in v0.10.1

func (a Advisory) FixedIn() string

FixedIn describes where the advisory is fixed, for user-facing output.

type Info

type Info struct {
	LatestVersion   string    `json:"latest_version"`
	CurrentVersion  string    `json:"current_version"`
	CheckedAt       time.Time `json:"checked_at"`
	UpdateAvailable bool      `json:"update_available"`
	// Advisories are the published advisories for the melange module, nil
	// when they could not be fetched. Use Affecting to match a version.
	Advisories []Advisory `json:"advisories"`
}

Info contains update check results

func CheckWithCache

func CheckWithCache(ctx context.Context) (*Info, error)

CheckWithCache checks for updates using cache when available

Jump to

Keyboard shortcuts

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