mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01:00
lib: return a protocol-based scope (dir or img)
Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
parent
678a2c1dcb
commit
faf21a67a6
@ -16,12 +16,19 @@ func IdentifyDistro(img *image.Image) *distro.Distro {
|
|||||||
return distro.Identify(img)
|
return distro.Identify(img)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CatalogImage(img *image.Image, o scope.Option) (*pkg.Catalog, error) {
|
func CatalogDir(d string, o scope.Option) (*pkg.Catalog, error) {
|
||||||
s, err := scope.NewScope(img, o)
|
s, err := scope.NewDirScope(d, o)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
return cataloger.Catalog(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CatalogImg(img *image.Image, o scope.Option) (*pkg.Catalog, error) {
|
||||||
|
s, err := scope.NewImageScope(img, o)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return cataloger.Catalog(s)
|
return cataloger.Catalog(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user