Help us shape the future of Go! Take the 2026 Go Developer Survey

app

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

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

Functions

func Execute

func Execute(version string)

Execute runs the ftv command line. version is the build version shown by --version; the cmd/ftv entrypoint supplies it.

func F2S

func F2S(i float64) string

F2S covert float64 to bool

func I2B

func I2B(i int) bool

I2B covert int to bool, if i >0:true, else false

func I2S

func I2S(i int) string

I2S covert int to string

func S2F

func S2F(i string) float64

S2F covert string to float64

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

type FilterOptions struct {
	Query         string
	Operator      string
	CaseSensitive bool
}

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

type SearchResult struct {
	Row int
	Col int
}

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.

Jump to

Keyboard shortcuts

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