ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: Apache-2.0 Imports: 18 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

This section is empty.

Variables

This section is empty.

Functions

func CatalogerStartedHandler

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

CatalogerStartedHandler periodically writes catalog statistics to a single line.

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 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, CatalogerStarted)

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