Documentation ¶
Index ¶
- func ByFileOwnershipOverlapWorker(accessor sbomsync.Accessor)
- func EvidentBy(catalog *pkg.Collection) []artifact.Relationship
- func ExcludeBinariesByFileOwnershipOverlap(accessor sbomsync.Accessor)
- func RemoveRelationshipsByID(relationships []artifact.Relationship, id artifact.ID) []artifact.Relationship
- func Sort(rels []artifact.Relationship)
- func ToSource(src artifact.Identifiable, c *pkg.Collection) []artifact.Relationship
- type Index
- func (i *Index) Add(relationships ...artifact.Relationship)
- func (i *Index) All(types ...artifact.RelationshipType) []artifact.Relationship
- func (i *Index) Contains(r artifact.Relationship) bool
- func (i *Index) Coordinates(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []file.Coordinates
- func (i *Index) From(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []artifact.Relationship
- func (i *Index) References(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []artifact.Relationship
- func (i *Index) Remove(id artifact.ID)
- func (i *Index) Replace(ogID artifact.ID, replacement artifact.Identifiable)
- func (i *Index) To(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []artifact.Relationship
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByFileOwnershipOverlapWorker ¶ added in v1.5.0
func EvidentBy ¶ added in v1.5.0
func EvidentBy(catalog *pkg.Collection) []artifact.Relationship
func ExcludeBinariesByFileOwnershipOverlap ¶ added in v1.5.0
func RemoveRelationshipsByID ¶
func RemoveRelationshipsByID(relationships []artifact.Relationship, id artifact.ID) []artifact.Relationship
TODO: put under test...
func Sort ¶
func Sort(rels []artifact.Relationship)
Sort takes a set of package-to-package relationships and sorts them in a stable order by name and version. Note: this does not consider package-to-other, other-to-package, or other-to-other relationships. TODO: ideally this should be replaced with a more type-agnostic sort function that resides in the artifact package.
func ToSource ¶ added in v1.5.0
func ToSource(src artifact.Identifiable, c *pkg.Collection) []artifact.Relationship
Types ¶
type Index ¶ added in v1.5.0
type Index struct {
// contains filtered or unexported fields
}
Index indexes relationships, preventing duplicates
func NewIndex ¶ added in v1.5.0
func NewIndex(relationships ...artifact.Relationship) *Index
NewIndex returns a new relationship Index
func (*Index) Add ¶ added in v1.5.0
func (i *Index) Add(relationships ...artifact.Relationship)
Add adds all the given relationships to the index, without adding duplicates
func (*Index) All ¶ added in v1.10.0
func (i *Index) All(types ...artifact.RelationshipType) []artifact.Relationship
All returns a sorted set of relationships matching all types, or all relationships if no types specified
func (*Index) Contains ¶ added in v1.10.0
func (i *Index) Contains(r artifact.Relationship) bool
Contains indicates the relationship is present in this index
func (*Index) Coordinates ¶ added in v1.10.0
func (i *Index) Coordinates(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []file.Coordinates
Coordinates returns all coordinates for the provided identifiable for provided relationship types If no types are provided, all relationship types are considered.
func (*Index) From ¶ added in v1.10.0
func (i *Index) From(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []artifact.Relationship
From returns all relationships from the given identifiable, with specified types
func (*Index) References ¶ added in v1.10.0
func (i *Index) References(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []artifact.Relationship
References returns all relationships that reference to or from the given identifiable
func (*Index) Replace ¶ added in v1.13.0
func (i *Index) Replace(ogID artifact.ID, replacement artifact.Identifiable)
func (*Index) To ¶ added in v1.10.0
func (i *Index) To(identifiable artifact.Identifiable, types ...artifact.RelationshipType) []artifact.Relationship
To returns all relationships to the given identifiable, with specified types