Documentation
¶
Overview ¶
Package app implements the ftv terminal table viewer: loading, the table model with filters and sorting, statistics and the tview user interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UI *tview.Pages
Functions ¶
Types ¶
type Args ¶
type Args struct {
FileName string
Sep string
SkipSymbol []string //ignore line with specified prefix
SkipNum int //Number of lines that should be skipped
ShowNum []int //columns that should be displayed
HideNum []int //columns that should be hidden
Header int //header display mode
NLine int //number of lines that should be displayed
Strict bool // check for missing data
AsyncLoad bool // enable async loading for progressive rendering
MemoryMB int // Memory limit in MB (0 = unlimited/default, >0 = custom limit)
Theme string // name of the colour scheme (see builtinThemes)
ConfigPath string // config file; empty means the default location
DumpConfig bool // print the default config and exit
}
Args struct
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer represents a table data structure with concurrent access support
type ClipboardConfig ¶ added in v0.10.1
type ClipboardConfig struct {
Command string `toml:"command"` // command reading the text on stdin; empty means auto-detect
OSC52 *bool `toml:"osc52"` // also emit the OSC 52 escape (default true)
}
ClipboardConfig overrides how yanked text reaches the clipboard.
type Config ¶ added in v0.10.0
type Config struct {
Keys map[string]keyList `toml:"keys"`
Theme map[string]string `toml:"theme"`
Clipboard ClipboardConfig `toml:"clipboard"`
}
Config is the on-disk configuration: key bindings and colour scheme.
[keys] move_left = ["h", "left"] # one key or a list; "g g" is a two-key sequence quit = "" # empty unbinds [theme] name = "subcore" # built-in scheme to start from accent = "colour101" # colour roles: colour<n>, #rrggbb or a colour name
type ContinuousStats ¶
type ContinuousStats struct {
// contains filtered or unexported fields
}
type DiscreteStats ¶
type DiscreteStats struct {
// contains filtered or unexported fields
}
type FilterOptions ¶
FilterOptions defines the parameters for a column filter.
type LoadProgress ¶
type LoadProgress struct {
TotalBytes atomic.Int64
LoadedBytes atomic.Int64
IsComplete atomic.Bool
}
LoadProgress tracks loading progress. It is written by the loader goroutine and read by the UI ticker, so the fields are atomic.
func (*LoadProgress) GetPercentage ¶
func (lp *LoadProgress) GetPercentage() float64
GetPercentage returns the loading percentage (0-100)
func (*LoadProgress) Reset ¶
func (lp *LoadProgress) Reset(total int64)
Reset prepares the tracker for a new load of the given total size (0 when unknown).
type SearchResult ¶
SearchResult represents a cell that matches search query
type Theme ¶ added in v0.9.5
type Theme struct {
Background tcell.Color // window and cell background
Text tcell.Color // default text
Dim tcell.Color // secondary text: footer position, hints, inactive borders
Panel tcell.Color // raised surfaces: header row, input fields, highlights
Stripe tcell.Color // alternate rows in the statistics table
Border tcell.Color // table separators
Accent tcell.Color // cursor, frozen column, footer file name, dialog borders, keys
Alert tcell.Color // active filters and the filter strip
Selection tcell.Color // background of cells inside a visual selection
}
Theme is the set of colours the UI draws with. Every element takes its colour from one of these roles, so a new scheme is just a new Theme value. Colours are tcell values: palette indices (tcell.PaletteColor), named colours (tcell.ColorRed) and true colour (tcell.NewHexColor) all work.