purl

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 6 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 purl builds, parses and compares package URLs, the product identifiers OpenVEX uses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PURL

type PURL struct {
	Type       string
	Namespace  string // slash-separated segments, decoded
	Name       string
	Version    string
	Qualifiers map[string]string
	Subpath    string // slash-separated segments, decoded
}

PURL is a package URL: pkg:type/namespace/name@version?qualifiers#subpath.

func Parse

func Parse(s string) (PURL, error)

Parse reads a package URL. Segments are decoded, so pkg:golang/github.com%2Fa%2Fb and pkg:golang/github.com/a/b name the same package.

func (PURL) Covers

func (p PURL) Covers(c PURL) bool

Covers reports whether p, as a VEX statement names a product, covers c: the same type and path ignoring case, the same version unless p sets none (a leading v doesn't count), the same subpath unless p sets none, and every qualifier of p on c with the same value.

func (PURL) String

func (p PURL) String() string

String returns the canonical form: each segment percent-encoded, qualifiers sorted by key.

Jump to

Keyboard shortcuts

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