fancy

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatusTable

type StatusTable struct {
	sync.Mutex
	// contains filtered or unexported fields
}

StatusTable holds a table where every line represents a test status.

func NewStatusTable

func NewStatusTable(height int) *StatusTable

NewStatusTable returns a table that renders test statuses.

func (*StatusTable) Event

func (s *StatusTable) Event(event string)

Event receives user events, this table has no action on events.

func (*StatusTable) Push

func (s *StatusTable) Push(res tui.Drawable)

Push pushes a new status row to the first line of the table.

type TUI

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

TUI is our Terminal User Interface.

func New

func New() (*TUI, error)

New returns a new Terminal User Interface reference.

func (*TUI) Close

func (t *TUI) Close()

Close ends the terminal user interface.

func (*TUI) PushResult

func (t *TUI) PushResult(res tui.Drawable)

PushResult shows a new test result in the interface.

func (*TUI) Start

func (t *TUI) Start()

Start initiates the Terminal User Interface.

It only returns when the user requires to close the interface.

type TestDetail

type TestDetail struct {
	sync.Mutex
	// contains filtered or unexported fields
}

TestDetail the box where we add the text.

func NewTestDetail

func NewTestDetail(y0, x1, y1 int) *TestDetail

NewTestDetail returns a new widget capable of rendering a test output.

func (*TestDetail) Event

func (r *TestDetail) Event(event string)

Event is called everytime the user generates an event, e.g. presses a key.

func (*TestDetail) Update

func (r *TestDetail) Update(res tui.Drawable)

Update sets the title and text to be rendered.

type TestsTable

type TestsTable struct {
	sync.Mutex

	OnSelRowChange func(tui.Drawable)
	// contains filtered or unexported fields
}

TestsTable is an ui component for rendering go test results.

Allow user to navigate through test results.

func NewTestsTable

func NewTestsTable(width, height int) *TestsTable

NewTestsTable returns a terminal ui component capable of rendering a table were we present the test outputs, one per row.

func (*TestsTable) Event

func (o *TestsTable) Event(event string)

Event is called everytime the user takes an action, e.g. presses a key.

func (*TestsTable) Push

func (o *TestsTable) Push(res tui.Drawable)

Push adds a new row to the begining of the table.

func (*TestsTable) SelectedRow

func (o *TestsTable) SelectedRow() int

SelectedRow returns the currently selected row index.

Jump to

Keyboard shortcuts

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