mirror of
https://github.com/anchore/grype
synced 2024-11-10 06:34:13 +00:00
add stringer support to match object
This commit is contained in:
parent
90074788d7
commit
27cb2cab5a
1 changed files with 9 additions and 5 deletions
|
@ -1,17 +1,21 @@
|
|||
package match
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/anchore/imgbom/imgbom/pkg"
|
||||
"github.com/anchore/vulnscan-db/pkg/vulnerability"
|
||||
"github.com/anchore/vulnscan/vulnscan/vulnerability"
|
||||
)
|
||||
|
||||
type Match struct {
|
||||
Confidence float64
|
||||
Vulnerability vulnerability.Vulnerability
|
||||
Package pkg.Package // is this needed? Or should we just capture the package ID (which is not stable between runs)?
|
||||
SearchKey string // what made this a hit? CPE, package-name-version, etc... we need to capture how this was matched (TODO)
|
||||
Package *pkg.Package
|
||||
// SearchKey provides an indication of how this match was found.
|
||||
// TODO: enhance this to be a rich object
|
||||
SearchKey string
|
||||
}
|
||||
|
||||
// TODO: delete me... this will be done in vulnscan-db
|
||||
type Store interface {
|
||||
func (m Match) String() string {
|
||||
return fmt.Sprintf("Match(pkg=%s vuln=%s key='%s' confidence=%f)", m.Package.String(), m.Vulnerability.String(), m.SearchKey, m.Confidence)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue