Documentation ¶
Overview ¶
Package ui provides all public UI elements intended to be repurposed in other applications. Specifically, a single Handler object is provided to allow consuming applications (such as grype) to check if there are UI elements the handler can respond to (given a specific event type) and handle the event in context of the given screen frame object.
Index ¶
- Constants
- func FetchImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func FileDigestsCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func FileIndexingStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func FileMetadataCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func ImportStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func PackageCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func PullDockerImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func ReadImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func SecretsCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- func UploadAttestationHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
- type Handler
Constants ¶
const StatusTitleColumn = 31
StatusTitleColumn is the column index in a given row where status text will be displayed.
Variables ¶
This section is empty.
Functions ¶
func FetchImageHandler ¶
func FetchImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
FetchImageHandler periodically writes a the image save and write-to-disk process in the form of a progress bar.
func FileDigestsCatalogerStartedHandler ¶ added in v0.15.0
func FileDigestsCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
FileMetadataCatalogerStartedHandler shows the intermittent secrets searching progress. nolint:dupl
func FileIndexingStartedHandler ¶ added in v0.19.0
func FileIndexingStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
FileIndexingStartedHandler shows the intermittent indexing progress from a directory resolver.
func FileMetadataCatalogerStartedHandler ¶ added in v0.15.0
func FileMetadataCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
FileMetadataCatalogerStartedHandler shows the intermittent secrets searching progress.
func ImportStartedHandler ¶ added in v0.10.0
func ImportStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
ImportStartedHandler shows the intermittent upload progress to Anchore Enterprise.
func PackageCatalogerStartedHandler ¶ added in v0.15.0
func PackageCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
PackageCatalogerStartedHandler periodically writes catalog statistics to a single line.
func PullDockerImageHandler ¶
func PullDockerImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
PullDockerImageHandler periodically writes a formatted line widget representing a docker image pull event.
func ReadImageHandler ¶
func ReadImageHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
ReadImageHandler periodically writes a the image read/parse/build-tree status in the form of a progress bar.
Types ¶
type Handler ¶
type Handler struct { }
Handler is an aggregated event handler for the set of supported events (PullDockerImage, ReadImage, FetchImage, PackageCatalogerStarted)
func (*Handler) Handle ¶
func (r *Handler) Handle(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error
Handle calls the specific event handler for the given event within the context of the screen frame.
func (*Handler) RespondsTo ¶
RespondsTo indicates if the handler is capable of handling the given event.