mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
20 lines
282 B
Go
20 lines
282 B
Go
package bus
|
|
|
|
import "github.com/wagoodman/go-partybus"
|
|
|
|
var publisher partybus.Publisher
|
|
var active bool
|
|
|
|
func SetPublisher(p partybus.Publisher) {
|
|
publisher = p
|
|
if p != nil {
|
|
active = true
|
|
}
|
|
}
|
|
|
|
func Publish(event partybus.Event) {
|
|
if active {
|
|
publisher.Publish(event)
|
|
}
|
|
}
|