display

package
v0.15.5-dev Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDiffEvent

func RenderDiffEvent(action apitype.UpdateKind, event engine.Event,
	seen map[resource.URN]engine.StepEventMetadata, opts Options) string

func ShowDiffEvents

func ShowDiffEvents(op string, action apitype.UpdateKind,
	events <-chan engine.Event, done chan<- bool, opts Options)

ShowDiffEvents displays the engine events with the diff view.

func ShowEvents

func ShowEvents(op string, action apitype.UpdateKind, stack tokens.QName, proj tokens.PackageName,
	events <-chan engine.Event, done chan<- bool, opts Options)

ShowEvents reads events from the `events` channel until it is closed, displaying each event as it comes in. Once all events have been read from the channel and displayed, it closes the `done` channel so the caller can await all the events being written.

func ShowProgressEvents

func ShowProgressEvents(op string, action apitype.UpdateKind, stack tokens.QName, proj tokens.PackageName,
	events <-chan engine.Event, done chan<- bool, opts Options)

ShowProgressEvents displays the engine events with docker's progress view.

func ShowProgressOutput

func ShowProgressOutput(in <-chan Progress, out io.Writer, isTerminal bool)

ShowProgressOutput displays a progress stream from `in` to `out`, `isTerminal` describes if `out` is a terminal. If this is the case, it will print `\n` at the end of each line and move the cursor while displaying.

Types

type DiagInfo

type DiagInfo struct {
	ErrorCount, WarningCount, InfoCount, DebugCount int

	// The very last diagnostic event we got for this resource (regardless of severity). We'll print
	// this out in the non-interactive mode whenever we get new events. Importantly, we don't want
	// to print out the most significant diagnostic, as that means a flurry of event swill cause us
	// to keep printing out the most significant diagnostic over and over again.
	LastDiag *engine.DiagEventPayload

	// The last event of each severity kind.  We'll print out the most significant of these (in the
	// tree-view) next to a resource while it is in progress.
	LastError, LastWarning, LastInfoError, LastInfo, LastDebug *engine.DiagEventPayload

	// All the diagnostic events we've heard about this resource.  We'll print the last diagnostic
	// in the status region while a resource is in progress.  At the end we'll print out all
	// diagnostics for a resource.
	//
	// Diagnostic events are bucketed by their associated stream ID (with 0 being the default
	// stream)
	StreamIDToDiagPayloads map[int32][]engine.DiagEventPayload
}

type Options

type Options struct {
	Color                colors.Colorization // colorization to apply to events.
	ShowConfig           bool                // true if we should show configuration information.
	ShowReplacementSteps bool                // true to show the replacement steps in the plan.
	ShowSameResources    bool                // true to show the resources that aren't updated in addition to updates.
	SummaryDiff          bool                // If the diff display should be summarized
	IsInteractive        bool                // If we should display things interactively
	DiffDisplay          bool                // true if we should display things as a rich diff
	Debug                bool
}

Options controls how the output of events are rendered

type Progress

type Progress struct {
	ID      string
	Message string
	Action  string
}

Progress describes a message we want to show in the display. There are two types of messages, simple 'Messages' which just get printed out as a single uninterpreted line, and 'Actions' which are placed and updated in the progress-grid based on their ID. Messages do not need an ID, while Actions must have an ID.

func (*Progress) Display

func (jm *Progress) Display(out io.Writer, termInfo termInfo)

Display displays the Progress to `out`. `termInfo` is non-nil if `out` is a terminal.

type ProgressDisplay

type ProgressDisplay struct {
	// contains filtered or unexported fields
}

type ResourceRow

type ResourceRow interface {
	Row

	Step() engine.StepEventMetadata
	SetStep(step engine.StepEventMetadata)
	AddOutputStep(step engine.StepEventMetadata)

	// The tick we were on when we created this row.  Purely used for generating an
	// ellipses to show progress for in-flight resources.
	Tick() int

	IsDone() bool

	SetFailed()

	DiagInfo() *DiagInfo
	RecordDiagEvent(diagEvent engine.Event)
}

type Row

type Row interface {
	DisplayOrderIndex() int
	SetDisplayOrderIndex(index int)

	ColorizedColumns() []string
	ColorizedSuffix() string

	HideRowIfUnnecessary() bool
	SetHideRowIfUnnecessary(value bool)
}

Jump to

Keyboard shortcuts

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