ui

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

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

View Source
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

func FileDigestsCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error

FileMetadataCatalogerStartedHandler shows the intermittent secrets searching progress.

func FileIndexingStartedHandler

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

func FileMetadataCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error

FileMetadataCatalogerStartedHandler shows the intermittent secrets searching progress.

func ImportStartedHandler

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

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.

func SecretsCatalogerStartedHandler

func SecretsCatalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error

SecretsCatalogerStartedHandler shows the intermittent secrets searching progress.

func UploadAttestationHandler

func UploadAttestationHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error

Types

type Handler

type Handler struct {
}

Handler is an aggregated event handler for the set of supported events (PullDockerImage, ReadImage, FetchImage, PackageCatalogerStarted)

func NewHandler

func NewHandler() *Handler

NewHandler returns an empty Handler

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

func (r *Handler) RespondsTo(event partybus.Event) bool

RespondsTo indicates if the handler is capable of handling the given event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL