normalize

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVersion = fmt.Errorf("invalid version")
)
View Source
var PURL_ECOSYSTEMS = map[string]string{
	"Alpine":    "apk",
	"crates.io": "cargo",
	"Debian":    "deb",
	"Go":        "golang",
	"Hackage":   "hackage",
	"Hex":       "hex",
	"Maven":     "maven",
	"npm":       "npm",
	"NuGet":     "nuget",
	"OSS-Fuzz":  "generic",
	"Packagist": "composer",
	"Pub":       "pub",
	"PyPI":      "pypi",
	"RubyGems":  "gem",
}

Functions

func CPEProductName

func CPEProductName(name string) string

func CPEProductVersion

func CPEProductVersion(version string) string

func ConvertToSemver

func ConvertToSemver(originalVersion string) string

ConvertToSemver converts any versioning scheme to a semver-like versioning scheme

func FromCdxBom

func FromCdxBom(bom *cdx.BOM, convertComponentType bool) *cdxBom

if the second parameter is set to true, the component type will be converted to the correct type THIS SHOULD ONLY be done, if the component type wasnt set by us. if the component type was set by us, we shouldnt change it

func PackageToPurl

func PackageToPurl(ecosystem, packageName string) string

func Purl

func Purl(component cdx.Component) string

func PurlToCPE

func PurlToCPE(purl string, componentType string) (string, error)

PurlToCPE maps a package URL (purl) to a Common Platform Enumeration (CPE)

func PurlToEcosystem

func PurlToEcosystem(purlType string) string

func SemverFix

func SemverFix(version string) (string, error)

func SemverSort added in v0.5.14

func SemverSort(versions []string)

Types

type SBOM

type SBOM interface {
	GetComponents() *[]cdx.Component
	GetDependencies() *[]cdx.Dependency
	GetMetadata() *cdx.Metadata
}

Jump to

Keyboard shortcuts

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