mirror of
https://github.com/anchore/syft.git
synced 2025-11-19 17:33:18 +01:00
* add marking package relations by file ownership Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * correct json schema version; ensure fileOwners dont return dups; pin test pkg versions Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * extract package relationships into separate section Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * pull in client-go features for import of PackageRelationships Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * move unit test for ownership by files relationship further down Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * rename relationship to "ownership-by-file-overlap" Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
21 lines
588 B
Go
21 lines
588 B
Go
package pkg
|
|
|
|
const (
|
|
// OwnershipByFileOverlapRelationship indicates that the parent package owns the child package made evident by the set of provided files
|
|
OwnershipByFileOverlapRelationship RelationshipType = "ownership-by-file-overlap"
|
|
)
|
|
|
|
type RelationshipType string
|
|
|
|
type Relationship struct {
|
|
Parent ID
|
|
Child ID
|
|
Type RelationshipType
|
|
Metadata interface{}
|
|
}
|
|
|
|
// TODO: as more relationships are added, this function signature will probably accommodate selection
|
|
func NewRelationships(catalog *Catalog) []Relationship {
|
|
return ownershipByFilesRelationships(catalog)
|
|
}
|