mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
Signed-off-by: Keith Zantow <kzantow@gmail.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
36 lines
561 B
Go
36 lines
561 B
Go
package bus
|
|
|
|
import (
|
|
"github.com/wagoodman/go-partybus"
|
|
|
|
"github.com/anchore/clio"
|
|
"github.com/anchore/syft/internal/redact"
|
|
"github.com/anchore/syft/syft/event"
|
|
)
|
|
|
|
func Exit() {
|
|
Publish(clio.ExitEvent(false))
|
|
}
|
|
|
|
func ExitWithInterrupt() {
|
|
Publish(clio.ExitEvent(true))
|
|
}
|
|
|
|
func Report(report string) {
|
|
if len(report) == 0 {
|
|
return
|
|
}
|
|
report = redact.Apply(report)
|
|
Publish(partybus.Event{
|
|
Type: event.CLIReport,
|
|
Value: report,
|
|
})
|
|
}
|
|
|
|
func Notify(message string) {
|
|
Publish(partybus.Event{
|
|
Type: event.CLINotification,
|
|
Value: message,
|
|
})
|
|
}
|