tui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is the root TUI application.

func NewApp

func NewApp(database *db.DB, profileName, profileColor, connUser string, readonly bool, engine *rules.Engine) *App

func (*App) Run

func (a *App) Run() error

type Command

type Command struct {
	Name     string
	Aliases  []string
	ViewName string
}

Command represents a colon-command with a canonical name, aliases, and the view it maps to.

type CommandRegistry

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

CommandRegistry holds all registered colon-commands.

func NewCommandRegistry

func NewCommandRegistry() *CommandRegistry

NewCommandRegistry creates a CommandRegistry populated with the MVP commands.

func (*CommandRegistry) Match

func (r *CommandRegistry) Match(input string) (string, bool)

Match performs a fuzzy-prefix match on the input against all command names and aliases. It returns the view name of the matched command and true if a unique match is found. If the input is ambiguous or matches nothing, it returns ("", false).

Examples:

"q"    -> ("queries", true)
"t"    -> ("tables", true)
"dash" -> ("dashboard", true)

type View

type View interface {
	Table() *tview.Table
	Start(app *tview.Application)
	Stop()
	ItemCount() int
	SetFilter(text string)
}

View is the interface all resource views implement.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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