latest

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package latest resolves "the latest version" of a package straight from its registry, for `lockvet pkg <ecosystem>:<name>` when no version is given. Each lookup asks the same registry the corresponding metadata layer already talks to (same base-URL variables, so tests fake one place), prefers the registry's own notion of "latest stable" where the API offers one, and otherwise picks the highest non-prerelease version lockvet's comparator can order.

Index

Constants

This section is empty.

Variables

View Source
var (
	// PyPIURL serves /pypi/{name}/json (info.version = latest stable).
	PyPIURL = "https://pypi.org"
	// NuGetFlatURL is the v3 flat container: /{id}/index.json lists all
	// versions ascending (the endpoint `dotnet add package` resolves from).
	NuGetFlatURL = "https://api.nuget.org/v3-flatcontainer"
)

Extra base URLs for registries whose metadata layer reads a different endpoint than the latest-version lookup wants; vars so tests can fake.

Functions

func Resolve

func Resolve(eco lock.Ecosystem, name string) (string, error)

Resolve returns the latest (stable, where the registry distinguishes) version of name in eco. A package that does not exist is an error. JSR packages arrive the way deno.lock records them: npm ecosystem, name prefixed "jsr:".

func Supported

func Supported(eco lock.Ecosystem) bool

Supported reports whether Resolve can look up a latest version for eco.

Types

This section is empty.

Jump to

Keyboard shortcuts

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