syft/imgbom/catalog_image.go
2020-05-18 11:59:33 -04:00

20 lines
473 B
Go

package imgbom
import (
"github.com/anchore/imgbom/imgbom/analyzer"
"github.com/anchore/imgbom/imgbom/pkg"
"github.com/anchore/imgbom/imgbom/scope"
"github.com/anchore/stereoscope/pkg/image"
)
// TODO: add os detection results as return value
func CatalogImage(img *image.Image, o scope.Option) (pkg.Catalog, error) {
s, err := scope.NewScope(img, o)
if err != nil {
return pkg.Catalog{}, err
}
// TODO: add OS detection here...
return analyzer.Analyze(s)
}