ui

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 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. nolint:dupl

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. nolint:dupl

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. nolint:dupl

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. nolint:dupl

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.

func SecretsCatalogerStartedHandler added in v0.15.0

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

SecretsCatalogerStartedHandler shows the intermittent secrets searching progress. nolint:dupl

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