mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +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)
|
||||
}
|
||||
|
||||
func CatalogImage(img *image.Image, o scope.Option) (*pkg.Catalog, error) {
|
||||
s, err := scope.NewScope(img, o)
|
||||
func CatalogDir(d string, o scope.Option) (*pkg.Catalog, error) {
|
||||
s, err := scope.NewDirScope(d, o)
|
||||
if err != nil {
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user