purl

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const (
	TypeOCI = "oci"

	// TypeK8s is a custom type for Kubernetes components in PURL.
	//  - namespace: The service provider such as EKS or GKE. It is not case sensitive and must be lowercased.
	//     Known namespaces:
	//       - empty (upstream)
	//       - eks (AWS)
	//       - aks (GCP)
	//       - gke (Azure)
	//       - rke (Rancher)
	//  - name: The k8s component name and is case sensitive.
	//  - version: The combined version and release of a component.
	//
	//  Examples:
	//    - pkg:k8s/upstream/k8s.io%2Fapiserver@1.24.1
	//    - pkg:k8s/eks/k8s.io%2Fkube-proxy@1.26.2-eksbuild.1
	TypeK8s = "k8s"

	NamespaceEKS = "eks"
	NamespaceAKS = "aks"
	NamespaceGKE = "gke"
	NamespaceRKE = "rke"
	NamespaceOCP = "ocp"

	TypeUnknown = "unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageURL

type PackageURL struct {
	packageurl.PackageURL
	FilePath string
}

func FromString added in v0.30.0

func FromString(s string) (*PackageURL, error)

func New added in v0.49.0

func New(t ftypes.TargetType, metadata types.Metadata, pkg ftypes.Package) (*PackageURL, error)

nolint: gocyclo

func WithPath added in v0.49.0

func WithPath(purl *packageurl.PackageURL, filePath string) *PackageURL

WithPath wraps packageurl.PackageURL with the given file path

func (*PackageURL) BOMRef

func (p *PackageURL) BOMRef() string

func (*PackageURL) Class added in v0.46.0

func (p *PackageURL) Class() types.ResultClass

func (*PackageURL) LangType added in v0.46.0

func (p *PackageURL) LangType() ftypes.LangType

LangType returns an application type in Trivy nolint: gocyclo

func (*PackageURL) Match added in v0.49.0

func (p *PackageURL) Match(target *packageurl.PackageURL) bool

Match returns true if the given PURL "target" satisfies the constraint PURL "p". - If the constraint does not have a version, it will match any version in the target. - If the constraint has qualifiers, the target must have the same set of qualifiers to match.

func (*PackageURL) Package added in v0.30.0

func (p *PackageURL) Package() *ftypes.Package

func (*PackageURL) Unwrap added in v0.49.0

func (p *PackageURL) Unwrap() *packageurl.PackageURL

Jump to

Keyboard shortcuts

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