mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 06:56:40 +01:00
Switch UI to bubbletea (#1888)
* add bubbletea UI Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * swap pipeline to go 1.20.x and add attest guard for cosign binary Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * update note in developing.md about the required golang version Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * fix merge conflict for windows path handling Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * temp test for attest handler Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * add addtional test iterations for background reader Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
+9
-9
@@ -16,20 +16,20 @@ package bus
|
||||
import "github.com/wagoodman/go-partybus"
|
||||
|
||||
var publisher partybus.Publisher
|
||||
var active bool
|
||||
|
||||
// SetPublisher sets the singleton event bus publisher. This is optional; if no bus is provided, the library will
|
||||
// Set sets the singleton event bus publisher. This is optional; if no bus is provided, the library will
|
||||
// behave no differently than if a bus had been provided.
|
||||
func SetPublisher(p partybus.Publisher) {
|
||||
func Set(p partybus.Publisher) {
|
||||
publisher = p
|
||||
if p != nil {
|
||||
active = true
|
||||
}
|
||||
}
|
||||
|
||||
func Get() partybus.Publisher {
|
||||
return publisher
|
||||
}
|
||||
|
||||
// Publish an event onto the bus. If there is no bus set by the calling application, this does nothing.
|
||||
func Publish(event partybus.Event) {
|
||||
if active {
|
||||
publisher.Publish(event)
|
||||
func Publish(e partybus.Event) {
|
||||
if publisher != nil {
|
||||
publisher.Publish(e)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user