ref

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CheckEcosystems = []string{
	"npm",
	"PyPI",
	"Go",
	"crates.io",
	"RubyGems",
	"Maven",
}

CheckEcosystems lists ecosystems queried for bare package names (no -e / no prefix).

Functions

func HasExplicitEcosystem

func HasExplicitEcosystem(input string) bool

HasExplicitEcosystem reports whether the input already pins a single ecosystem.

func IsAdvisoryID

func IsAdvisoryID(input string) bool

IsAdvisoryID reports whether input is an OSV advisory identifier rather than a package ref.

func IsKnownEcosystem

func IsKnownEcosystem(eco string) bool

IsKnownEcosystem reports whether eco names a supported ecosystem, accepting common synonyms (e.g. "golang" -> Go, "pypi" -> PyPI, "cargo" -> crates.io).

func ParseBare

func ParseBare(input string) (name, version string, err error)

ParseBare splits a bare package name (no ecosystem prefix) into name and version.

Types

type PackageRef

type PackageRef struct {
	Ecosystem string
	Name      string
	Version   string
	Raw       string
}

func Parse

func Parse(input, defaultEcosystem string) (PackageRef, error)

func (PackageRef) OSVPackage

func (r PackageRef) OSVPackage() map[string]string

func (PackageRef) String

func (r PackageRef) String() string

Jump to

Keyboard shortcuts

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