tui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package tui provides an ability to draw charts on the terminal.

Package tui is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineChart

type LineChart interface {
	widgetapi.Widget
	Series(label string, values []float64, opts ...linechart.SeriesOption) error
}

type MockLineChart

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

MockLineChart is a mock of LineChart interface

func NewMockLineChart

func NewMockLineChart(ctrl *gomock.Controller) *MockLineChart

NewMockLineChart creates a new mock instance

func (*MockLineChart) Draw

func (m *MockLineChart) Draw(cvs *canvas.Canvas, meta *widgetapi.Meta) error

Draw mocks base method

func (*MockLineChart) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockLineChart) Keyboard

func (m *MockLineChart) Keyboard(k *terminalapi.Keyboard) error

Keyboard mocks base method

func (*MockLineChart) Mouse

func (m_2 *MockLineChart) Mouse(m *terminalapi.Mouse) error

Mouse mocks base method

func (*MockLineChart) Options

func (m *MockLineChart) Options() widgetapi.Options

Options mocks base method

func (*MockLineChart) Series

func (m *MockLineChart) Series(label string, values []float64, opts ...linechart.SeriesOption) error

Series mocks base method

type MockLineChartMockRecorder

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

MockLineChartMockRecorder is the mock recorder for MockLineChart

func (*MockLineChartMockRecorder) Draw

func (mr *MockLineChartMockRecorder) Draw(cvs, meta interface{}) *gomock.Call

Draw indicates an expected call of Draw

func (*MockLineChartMockRecorder) Keyboard

func (mr *MockLineChartMockRecorder) Keyboard(k interface{}) *gomock.Call

Keyboard indicates an expected call of Keyboard

func (*MockLineChartMockRecorder) Mouse

func (mr *MockLineChartMockRecorder) Mouse(m interface{}) *gomock.Call

Mouse indicates an expected call of Mouse

func (*MockLineChartMockRecorder) Options

func (mr *MockLineChartMockRecorder) Options() *gomock.Call

Options indicates an expected call of Options

func (*MockLineChartMockRecorder) Series

func (mr *MockLineChartMockRecorder) Series(label, values interface{}, opts ...interface{}) *gomock.Call

Series indicates an expected call of Series

type MockText

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

MockText is a mock of Text interface

func NewMockText

func NewMockText(ctrl *gomock.Controller) *MockText

NewMockText creates a new mock instance

func (*MockText) Draw

func (m *MockText) Draw(cvs *canvas.Canvas, meta *widgetapi.Meta) error

Draw mocks base method

func (*MockText) EXPECT

func (m *MockText) EXPECT() *MockTextMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockText) Keyboard

func (m *MockText) Keyboard(k *terminalapi.Keyboard) error

Keyboard mocks base method

func (*MockText) Mouse

func (m_2 *MockText) Mouse(m *terminalapi.Mouse) error

Mouse mocks base method

func (*MockText) Options

func (m *MockText) Options() widgetapi.Options

Options mocks base method

func (*MockText) Write

func (m *MockText) Write(text string, wOpts ...text.WriteOption) error

Write mocks base method

type MockTextMockRecorder

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

MockTextMockRecorder is the mock recorder for MockText

func (*MockTextMockRecorder) Draw

func (mr *MockTextMockRecorder) Draw(cvs, meta interface{}) *gomock.Call

Draw indicates an expected call of Draw

func (*MockTextMockRecorder) Keyboard

func (mr *MockTextMockRecorder) Keyboard(k interface{}) *gomock.Call

Keyboard indicates an expected call of Keyboard

func (*MockTextMockRecorder) Mouse

func (mr *MockTextMockRecorder) Mouse(m interface{}) *gomock.Call

Mouse indicates an expected call of Mouse

func (*MockTextMockRecorder) Options

func (mr *MockTextMockRecorder) Options() *gomock.Call

Options indicates an expected call of Options

func (*MockTextMockRecorder) Write

func (mr *MockTextMockRecorder) Write(text interface{}, wOpts ...interface{}) *gomock.Call

Write indicates an expected call of Write

type TUI

type TUI struct {
	// How often termdash redraws the screen.
	RedrawInterval time.Duration
	// The function to quit the application.
	Cancel context.CancelFunc
	// A channel for receiving data sources to draw on the chart.
	StatsCh <-chan *stats.Stats
	// Metadata of the process where the agent runs on.
	Metadata stats.Meta
	// contains filtered or unexported fields
}

func NewTUI

func NewTUI(redrawInterval time.Duration, cancel context.CancelFunc, statsCh <-chan *stats.Stats, metadata *stats.Meta) *TUI

func (*TUI) Run

func (g *TUI) Run(ctx context.Context) error

Run starts drawing charts, and blocks until the quit operation is performed.

type Text

type Text interface {
	widgetapi.Widget
	Write(text string, wOpts ...text.WriteOption) error
}

Jump to

Keyboard shortcuts

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