pkgspec

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pkgspec parses `lockvet pkg` package specs — <ecosystem>:<name>[@version] — into the ecosystem, the name as the matching lockfile format would record it, and the version. Shared by the CLI, the MCP server, and the browser playground so every entry point accepts identical specs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	Eco     lock.Ecosystem
	Name    string // as the matching lockfile format would record it
	Version string // empty = resolve latest from the registry
	Channel string // conda only: the anaconda.org channel (default conda-forge)
	Label   string // canonical spec, used as the report heading
}

Spec is one parsed `eco:name[@version]` argument.

func Parse

func Parse(arg string) (Spec, error)

Parse splits eco:name[@version]. The version separator is the LAST "@" past the first character of the name, so scoped npm names (npm:@types/node, npm:@types/node@24.0.0) parse naturally.

func (Spec) File

func (s Spec) File() *lock.File

File builds the synthetic one-package lockfile for the spec; diffing it against nothing runs the whole vetting pipeline over just this package. Version must be set (parsed or resolved) before calling.

func (Spec) LookupName

func (s Spec) LookupName() string

LookupName is the name to ask the registry's latest-version resolver about (conda prefixes the channel).

Jump to

Keyboard shortcuts

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