mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 07:56:36 +01:00
update sterescope + add json presenter
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -54,7 +54,6 @@ func (a *Analyzer) Analyze(contents map[file.Reference]string) ([]pkg.Package, e
|
||||
Metadata: entry,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
return packages, nil
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user