mirror of
https://github.com/anchore/syft.git
synced 2026-10-30 14:02:26 +01:00
rename to syft
This commit is contained in:
@@ -4,13 +4,13 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
imgbomEventParsers "github.com/anchore/imgbom/imgbom/event/parsers"
|
||||
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 := imgbomEventParsers.ParseCatalogerFinished(event)
|
||||
pres, err := syftEventParsers.ParseCatalogerFinished(event)
|
||||
if err != nil {
|
||||
return fmt.Errorf("bad CatalogerFinished event: %w", err)
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
imgbomEvent "github.com/anchore/imgbom/imgbom/event"
|
||||
"github.com/anchore/imgbom/internal/log"
|
||||
"github.com/anchore/imgbom/internal/ui/common"
|
||||
stereoscopeEvent "github.com/anchore/stereoscope/pkg/event"
|
||||
"github.com/anchore/syft/internal/log"
|
||||
"github.com/anchore/syft/internal/ui/common"
|
||||
syftEvent "github.com/anchore/syft/syft/event"
|
||||
"github.com/wagoodman/go-partybus"
|
||||
"github.com/wagoodman/jotframe/pkg/frame"
|
||||
)
|
||||
@@ -68,7 +68,7 @@ eventLoop:
|
||||
break eventLoop
|
||||
}
|
||||
switch e.Type {
|
||||
case imgbomEvent.AppUpdateAvailable:
|
||||
case syftEvent.AppUpdateAvailable:
|
||||
err = appUpdateAvailableHandler(ctx, fr, e, wg)
|
||||
if err != nil {
|
||||
log.Errorf("unable to show AppUpdateAvailable event: %+v", err)
|
||||
@@ -86,12 +86,12 @@ eventLoop:
|
||||
log.Errorf("unable to show FetchImage event: %+v", err)
|
||||
}
|
||||
|
||||
case imgbomEvent.CatalogerStarted:
|
||||
case syftEvent.CatalogerStarted:
|
||||
err = catalogerStartedHandler(ctx, fr, e, wg)
|
||||
if err != nil {
|
||||
log.Errorf("unable to show CatalogerStarted event: %+v", err)
|
||||
}
|
||||
case imgbomEvent.CatalogerFinished:
|
||||
case syftEvent.CatalogerFinished:
|
||||
// we may have other background processes still displaying progress, wait for them to
|
||||
// finish before discontinuing dynamic content and showing the final report
|
||||
wg.Wait()
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
imgbomEventParsers "github.com/anchore/imgbom/imgbom/event/parsers"
|
||||
stereoEventParsers "github.com/anchore/stereoscope/pkg/event/parsers"
|
||||
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
|
||||
"github.com/gookit/color"
|
||||
"github.com/wagoodman/go-partybus"
|
||||
"github.com/wagoodman/go-progress"
|
||||
@@ -111,7 +111,7 @@ func imageReadHandler(ctx context.Context, fr *frame.Frame, event partybus.Event
|
||||
}
|
||||
|
||||
func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error {
|
||||
monitor, err := imgbomEventParsers.ParseCatalogerStarted(event)
|
||||
monitor, err := syftEventParsers.ParseCatalogerStarted(event)
|
||||
if err != nil {
|
||||
return fmt.Errorf("bad CatalogerStarted event: %w", err)
|
||||
}
|
||||
@@ -145,7 +145,7 @@ func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybu
|
||||
}
|
||||
|
||||
func appUpdateAvailableHandler(_ context.Context, fr *frame.Frame, event partybus.Event, _ *sync.WaitGroup) error {
|
||||
newVersion, err := imgbomEventParsers.ParseAppUpdateAvailable(event)
|
||||
newVersion, err := syftEventParsers.ParseAppUpdateAvailable(event)
|
||||
if err != nil {
|
||||
return fmt.Errorf("bad AppUpdateAvailable event: %w", err)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
imgbomEvent "github.com/anchore/imgbom/imgbom/event"
|
||||
"github.com/anchore/imgbom/internal/log"
|
||||
"github.com/anchore/imgbom/internal/ui/common"
|
||||
"github.com/anchore/syft/internal/log"
|
||||
"github.com/anchore/syft/internal/ui/common"
|
||||
syftEvent "github.com/anchore/syft/syft/event"
|
||||
"github.com/wagoodman/go-partybus"
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ eventLoop:
|
||||
}
|
||||
|
||||
// ignore all events except for the final event
|
||||
if e.Type == imgbomEvent.CatalogerFinished {
|
||||
if e.Type == syftEvent.CatalogerFinished {
|
||||
err := common.CatalogerFinishedHandler(e)
|
||||
if err != nil {
|
||||
log.Errorf("unable to show catalog image finished event: %+v", err)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/anchore/imgbom/internal/ui/etui"
|
||||
"github.com/anchore/syft/internal/ui/etui"
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user