add java cataloger

This commit is contained in:
Alex Goodman
2020-07-08 16:16:01 -04:00
parent e040fc8930
commit e55db9247e
95 changed files with 2120 additions and 45 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ package pkg
const (
UnknownLanguage Language = iota
//Java
Java
//JavaScript
Python
Ruby
@@ -12,14 +12,14 @@ type Language uint
var languageStr = []string{
"UnknownLanguage",
//"java",
"java",
//"javascript",
"python",
"ruby",
}
var AllLanguages = []Language{
//Java,
Java,
//JavaScript,
Python,
Ruby,
+27
View File
@@ -14,3 +14,30 @@ type RpmMetadata struct {
Arch string `mapstructure:"Arch"`
Release string `mapstructure:"Release"`
}
type JavaManifest struct {
Name string `mapstructure:"Name"`
ManifestVersion string `mapstructure:"Manifest-Version"`
SpecTitle string `mapstructure:"Specification-Title"`
SpecVersion string `mapstructure:"Specification-Version"`
SpecVendor string `mapstructure:"Specification-Vendor"`
ImplTitle string `mapstructure:"Implementation-Title"`
ImplVersion string `mapstructure:"Implementation-Version"`
ImplVendor string `mapstructure:"Implementation-Vendor"`
Extra map[string]string `mapstructure:",remain"`
}
type PomProperties struct {
Path string
Name string `mapstructure:"name"`
GroupID string `mapstructure:"groupId"`
ArtifactID string `mapstructure:"artifactId"`
Version string `mapstructure:"version"`
Extra map[string]string `mapstructure:",remain"`
}
type JavaMetadata struct {
Manifest *JavaManifest `mapstructure:"Manifest"`
PomProperties *PomProperties `mapstructure:"PomProperties"`
Parent *Package
}
+3 -1
View File
@@ -9,8 +9,10 @@ import (
type ID int64
// TODO: add field to trace which cataloger detected this
// Package represents an application or library that has been bundled into a distributable format
type Package struct {
id ID
id ID // this is set when a package is added to the catalog
Name string
Version string
FoundBy string
+15
View File
@@ -9,6 +9,11 @@ const (
//PacmanPkg
RpmPkg
WheelPkg
JarPkg
WarPkg
EarPkg
JpiPkg
HpiPkg
)
type Type uint
@@ -22,6 +27,11 @@ var typeStr = []string{
//"pacman",
"rpm",
"wheel",
"jar",
"war",
"ear",
"jpi",
"hpi",
}
var AllPkgs = []Type{
@@ -32,6 +42,11 @@ var AllPkgs = []Type{
//PacmanPkg,
RpmPkg,
WheelPkg,
JarPkg,
WarPkg,
EarPkg,
JpiPkg,
HpiPkg,
}
func (t Type) String() string {