mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
23 lines
509 B
Go
23 lines
509 B
Go
package common
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
|
|
"github.com/wagoodman/go-partybus"
|
|
)
|
|
|
|
func CatalogerFinishedHandler(event partybus.Event) error {
|
|
// show the report to stdout
|
|
pres, err := syftEventParsers.ParseCatalogerFinished(event)
|
|
if err != nil {
|
|
return fmt.Errorf("bad CatalogerFinished event: %w", err)
|
|
}
|
|
|
|
if err := pres.Present(os.Stdout); err != nil {
|
|
return fmt.Errorf("unable to show package catalog report: %w", err)
|
|
}
|
|
return nil
|
|
}
|