Documentation
¶
Index ¶
- Variables
- func ArtifactPurl(scanner string, assetName string) string
- func ConvertToSemver(originalVersion string) string
- func FixFixedVersion(purl string, fixedVersion *string) *string
- func FromCdxBom(bom *cdx.BOM, convertComponentType bool) *cdxBom
- func MapCDXToStatus(a *cdx.VulnerabilityAnalysis) string
- func MergeCdxBoms(metadata *cdx.Metadata, boms ...*cdx.BOM) *cdx.BOM
- func PackageToPurl(ecosystem, packageName string) string
- func Purl(component cdx.Component) string
- func PurlToEcosystem(purlType string) string
- func SemverFix(version string) (string, error)
- func SemverSort(versions []string)
- type SBOM
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidVersion = fmt.Errorf("invalid version")
)
View Source
var PURLEcosystems = 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",
}
View Source
var ValidSemverRegex = regexp.MustCompile(`^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`)
Regex for validating a correct semver.
Functions ¶
func ArtifactPurl ¶ added in v0.17.2
func ConvertToSemver ¶
ConvertToSemver converts any versioning scheme to a semver-like versioning scheme
func FixFixedVersion ¶ added in v0.17.2
func FromCdxBom ¶
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 MapCDXToStatus ¶ added in v0.17.2
func MapCDXToStatus(a *cdx.VulnerabilityAnalysis) string
map CycloneDX Analysis State / Response to internal status strings used by UpdateDependencyVulnState
func MergeCdxBoms ¶ added in v0.17.2
func PackageToPurl ¶
func PurlToEcosystem ¶
func SemverSort ¶ added in v0.5.14
func SemverSort(versions []string)
Types ¶
Click to show internal directories.
Click to hide internal directories.