renderers

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InteractiveRenderer

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

InteractiveRenderer is a interactive rendere which is a dynamic one. It's a implementation of LogRenderer

It conains a bufio.Writer for output, a root node and terminal height

func NewInteractiveRenderer

func NewInteractiveRenderer(out *os.File, rendererConfig *config.InteractiveRendererConfig) *InteractiveRenderer

NewInteractiveRenderer creates a new InteractiveRenderer

func (*InteractiveRenderer) DrawFrame

func (r *InteractiveRenderer) DrawFrame()

DrawFrame will first generate full output lines and put it to terminal.

This function is coroutine safe.

func (*InteractiveRenderer) RenderMessage

func (r *InteractiveRenderer) RenderMessage(entry *echelon.LogEntryMessage)

RenderMessage will render message of node specified by entry, it will add the messages of entry to the node.

func (*InteractiveRenderer) RenderProcess added in v1.3.3

func (r *InteractiveRenderer) RenderProcess(entry *echelon.LogProcessMessage)

RenderProcess will set progress of node specified by entry

func (*InteractiveRenderer) RenderScopeFinished

func (r *InteractiveRenderer) RenderScopeFinished(entry *echelon.LogScopeFinished)

RenderScopeFinished will render an finished node specified by entry.

If the node is succeeded, all sub nodes (which must be succeeded as well) will hides. If the node is failed, the node will keep showing at output with FailureColor(red)

func (*InteractiveRenderer) RenderScopeStarted

func (r *InteractiveRenderer) RenderScopeStarted(entry *echelon.LogScopeStarted)

RenderScopeStarted starts render the node specified by the entry

func (*InteractiveRenderer) StartDrawing

func (r *InteractiveRenderer) StartDrawing()

StartDrawing will start drawing Interactiverenderer until the root node has completed

Each two frame has a time gap which can be configured in InteractiveRenderer.config.RefreshRate

func (*InteractiveRenderer) StopDrawing

func (r *InteractiveRenderer) StopDrawing()

StopDrawing will stop the InteractiveRenderer, it will complete the root node and draw final frame

type SimpleRenderer

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

SimpleRenderer is a simple renderer with an io.Writer for output, a color for output color, and a map to save time stamps. The key of time stamps is the path of scope.

func NewSimpleRenderer

func NewSimpleRenderer(out io.Writer, colors *terminal.ColorSchema) *SimpleRenderer

NewSimpleRenderer creates a simple renderer

func (SimpleRenderer) RenderMessage

func (r SimpleRenderer) RenderMessage(entry *echelon.LogEntryMessage)

RenderMessage will render message from entry for simple renderer, it sends message of entry to renderEntry of renderer.

func (SimpleRenderer) RenderProcess added in v1.3.3

func (r SimpleRenderer) RenderProcess(entry *echelon.LogProcessMessage)

RenderProcess function of SimpleRenderer, it will do nothing, simple renderer doesn't support process rendering

func (SimpleRenderer) RenderScopeFinished

func (r SimpleRenderer) RenderScopeFinished(entry *echelon.LogScopeFinished)

RenderScopeFinished will render a finished entry, which will print to task result of an entry.

func (SimpleRenderer) RenderScopeStarted

func (r SimpleRenderer) RenderScopeStarted(entry *echelon.LogScopeStarted)

RenderScopeStarted function of SimpleRenderer, it will start rendering an message of entry.

func (SimpleRenderer) ScopeHasStarted

func (r SimpleRenderer) ScopeHasStarted(scopes []string) bool

ScopeHasStarted returns whether the scope specified by path 'scpoes' has started. A finished scope is still started.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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