tui

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Copyright © 2019 Portworx

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	TOP_LINE_HEIGHT   = 2
	TABLE_WIDTH_RATIO = 0.75 // Occupy 75% of terminal
	MAX_GRAPH_POINTS  = 400
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StatsModel

type StatsModel interface {
	// Refresh will load  new set of data
	Refresh() error
	// GetTitle returns the title of the table
	GetTitle() string
	// GetHeaders will returns the colume titles for the table
	GetHeaders() []string
	// NextRow return of a zero length array indicates iteration is complete
	NextRow() ([]string, error)
	// SetSort sets the  column to sort on and sets the order of sort
	SetSortInfo(colName string, ascending bool)
	// GetSortInfo get the sort info
	GetSortInfo() (string, bool)
	// Moves the sorting to the next column
	MoveSortColumnNext()
	// Moves the sorting to the prev column
	MoveSortColumnPrev()
	// GetGraphTitle returns the title for the given graph index
	GetGraphTitle(index int) (string, error)
	// GetGraphData returns the current datapoint for the given graph
	GetGraphData(index int) (float64, error)
	// Humanize formats the given value into a string that is easy to read
	Humanize(index int, val float64) (string, error)
}

type View

type View interface {
	Display(ti StatsModel, refreshInterval time.Duration) error
}

func NewStatsView

func NewStatsView(numPlots int) View

Jump to

Keyboard shortcuts

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