update sterescope + add json presenter

This commit is contained in:
Alex Goodman
2020-05-20 18:29:06 -04:00
parent 28cc9b3dc1
commit 17b4b26fbb
21 changed files with 372 additions and 67 deletions
+1
View File
@@ -7,6 +7,7 @@ import (
)
type Analyzer interface {
// TODO: add ID / Name for analyze for uniquely identifying this analyzer type
SelectFiles([]*tree.FileTree) []file.Reference
// NOTE: one of the errors which is returned is "IterationNeeded", which indicates to the driver to
// continue with another Select/Analyze pass
-1
View File
@@ -54,7 +54,6 @@ func (a *Analyzer) Analyze(contents map[file.Reference]string) ([]pkg.Package, e
Metadata: entry,
})
}
}
return packages, nil
}
-30
View File
@@ -1,30 +0,0 @@
package dummy
import (
"github.com/anchore/imgbom/imgbom/pkg"
"github.com/anchore/stereoscope/pkg/file"
"github.com/anchore/stereoscope/pkg/tree"
)
// TODO: delete me
type Analyzer struct{}
func NewAnalyzer() *Analyzer {
return &Analyzer{}
}
func (a *Analyzer) SelectFiles(trees []*tree.FileTree) []file.Reference {
return []file.Reference{*trees[0].File("/etc/centos-release")}
}
func (a *Analyzer) Analyze(contents map[file.Reference]string) ([]pkg.Package, error) {
return []pkg.Package{
{
Name: "dummy",
Version: "1.0.0",
Type: pkg.DebPkg,
Metadata: pkg.DummyPackage{Extra: "some extra metadata"},
},
}, nil
}