add cataloger for rust crates from Cargo.lock files

Signed-off-by: Weston Steimel <weston.steimel@gmail.com>
This commit is contained in:
Weston Steimel
2021-03-18 03:12:51 +00:00
parent a83d79f330
commit ba81bfe529
13 changed files with 313 additions and 0 deletions
+4
View File
@@ -17,6 +17,7 @@ const (
JavaPkg Type = "java-archive"
JenkinsPluginPkg Type = "jenkins-plugin"
GoModulePkg Type = "go-module"
RustPkg Type = "rust-crate"
)
// AllPkgs represents all supported package types
@@ -30,6 +31,7 @@ var AllPkgs = []Type{
JavaPkg,
JenkinsPluginPkg,
GoModulePkg,
RustPkg,
}
// PackageURLType returns the PURL package type for the current package.
@@ -51,6 +53,8 @@ func (t Type) PackageURLType() string {
return packageurl.TypeRPM
case GoModulePkg:
return packageurl.TypeGolang
case RustPkg:
return "cargo"
default:
// TODO: should this be a "generic" purl type instead?
return ""