semverpick

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 5 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 semverpick selects versions from candidate lists: the newest stable release satisfying a constraint (chart and artifact update checks), and the newest tag that has soaked past a cooldown window (tracked-image picks, where a just-published tag can still be yanked or hot-fixed).

Only release versions of the shape X.Y.Z — optionally v-prefixed — are ever considered; pre-releases and build metadata are filtered out before constraint evaluation, because the mirror only ships releases. All wall-clock input is injected, keeping the package deterministic under test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CooldownPick

func CooldownPick(candidates []string, constraint string, cooldown time.Duration,
	now time.Time, created CreatedFunc, onSkip func(tag, reason string)) (string, error)

CooldownPick walks release candidates newest-first and returns the first tag published at least cooldown before now, so a release yanked or hot-fixed within its soak period is never the one the mirror adopts. Tags failing constraint are skipped without counting against the candidate cap; skipped-inside-cooldown tags are reported through onSkip (nil is fine). A cooldown of zero picks the newest satisfying tag.

func Newest

func Newest(current string, candidates []string, constraint string) (string, bool, error)

Newest returns the newest release among candidates that satisfies constraint and is strictly newer than current, or ("", false) when the current pin is already the best available. Non-release candidates are skipped; current must itself parse as a version.

func Releases

func Releases(candidates []string) []string

Releases filters candidates down to release versions and returns them sorted newest first. The returned strings are the original tags (any v prefix intact); ordering compares the parsed versions.

func Satisfies

func Satisfies(version, constraint string) (bool, error)

Satisfies reports whether version (a release, optionally v-prefixed) satisfies constraint. An empty constraint admits everything.

Types

type CreatedFunc

type CreatedFunc func(tag string) (created time.Time, ok bool, err error)

CreatedFunc reports when a tag was published. ok=false means the registry records no creation timestamp for the tag; the walk skips it with a warning rather than failing.

Jump to

Keyboard shortcuts

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