Help us shape the future of Go! Take the 2026 Go Developer Survey

packages

package
v0.29.0 Latest Latest
Warning

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

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

Documentation

Overview

Package packages resolves package manager declarations to exact pinned versions.

It queries public registries (PyPI for pip, crandb for CRAN) to find the latest or specified version of each package, returning a ResolvedPackageSet suitable for inclusion in a lockfile. Conda packages are pinned as-declared because no stable public REST API exists for conda-forge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveAll

func ResolveAll(ctx context.Context, specs []spec.PackageSpec) ([]spec.ResolvedPackageSet, error)

ResolveAll resolves each PackageSpec in the profile to pinned versions. pip and cran query public APIs; conda pins versions as-declared.

func VerifyPipHashes

func VerifyPipHashes(ctx context.Context, sets []spec.ResolvedPackageSet) []string

VerifyPipHashes queries PyPI for each pip package in sets and returns a slice of human-readable error strings for any SHA256 mismatches. Entries with an empty SHA256 in the lockfile are skipped.

Types

type Resolver

type Resolver struct {
	// Client is the HTTP client used for registry API calls.
	// nil uses http.DefaultClient.
	Client *http.Client

	// BaseURL overrides the registry base URL for testing.
	// When set, PyPI calls use "<BaseURL>/pypi/..." and CRAN calls use "<BaseURL>/...".
	// Empty string (default) uses the real public registry URLs.
	BaseURL string
}

Resolver resolves package declarations to pinned versions using public registries. The zero value is ready to use (HTTP calls use http.DefaultClient).

func (*Resolver) ResolveAll

func (r *Resolver) ResolveAll(ctx context.Context, specs []spec.PackageSpec) ([]spec.ResolvedPackageSet, error)

ResolveAll resolves each PackageSpec to pinned versions using the receiver's HTTP client.

Jump to

Keyboard shortcuts

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