mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
Add check for app update (#88)
* add check for app update; fix ETUI error handling * validate user args
This commit is contained in:
@@ -3,6 +3,7 @@ package event
|
||||
import "github.com/wagoodman/go-partybus"
|
||||
|
||||
const (
|
||||
CatalogerStarted partybus.EventType = "cataloger-started-event"
|
||||
CatalogerFinished partybus.EventType = "cataloger-finished-event"
|
||||
AppUpdateAvailable partybus.EventType = "app-update-available"
|
||||
CatalogerStarted partybus.EventType = "cataloger-started-event"
|
||||
CatalogerFinished partybus.EventType = "cataloger-finished-event"
|
||||
)
|
||||
|
||||
@@ -59,3 +59,16 @@ func ParseCatalogerFinished(e partybus.Event) (presenter.Presenter, error) {
|
||||
|
||||
return pres, nil
|
||||
}
|
||||
|
||||
func ParseAppUpdateAvailable(e partybus.Event) (string, error) {
|
||||
if err := checkEventType(e.Type, event.AppUpdateAvailable); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
newVersion, ok := e.Value.(string)
|
||||
if !ok {
|
||||
return "", newPayloadErr(e.Type, "Value", e.Value)
|
||||
}
|
||||
|
||||
return newVersion, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user