Upgrade generic cataloger (#1281)

* add second generation of generic cataloger

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* upgrade aplm cataloger to use generic.Cataloger

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* remove pacakge found-by attribute from the definition of a package ID

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2022-10-24 11:12:12 -04:00
committed by GitHub
parent 7a8b96abc2
commit b44f441c82
40 changed files with 495 additions and 245 deletions
+7
View File
@@ -92,6 +92,13 @@ func NewVirtualLocationFromDirectory(responsePath, virtualResponsePath string, r
}
}
func (l Location) AccessPath() string {
if l.VirtualPath != "" {
return l.VirtualPath
}
return l.RealPath
}
func (l Location) String() string {
str := ""
if l.ref.ID() != 0 {
+15
View File
@@ -0,0 +1,15 @@
package source
import "io"
type LocationReadCloser struct {
Location
io.ReadCloser
}
func NewLocationReadCloser(location Location, reader io.ReadCloser) LocationReadCloser {
return LocationReadCloser{
Location: location,
ReadCloser: reader,
}
}