ui

package
v0.0.0-...-a915086 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintDeletionSummary

func PrintDeletionSummary(w io.Writer, freed int64, count int)

func PrintJSON

func PrintJSON(w io.Writer, results []scanner.ScanResult) error

PrintJSON writes results as a JSON array to w.

func PrintTable

func PrintTable(w io.Writer, results []scanner.ScanResult) error

PrintTable writes a human-readable table of results to w, sorted largest-first.

func RunPicker

func RunPicker(w io.Writer, items []scanner.ScanResult) ([]scanner.ScanResult, error)

RunPicker runs the interactive TUI and returns selected results. Output goes to w so stdout stays clean for piping.

func RunWithSpinner

func RunWithSpinner[T any](w io.Writer, label string, fn func() T) T

RunWithSpinner runs fn while displaying a spinner on w. Falls back to a plain status line when w is not a TTY.

Types

type DeletionResult

type DeletionResult struct {
	Freed  int64
	Errors []error
}

DeletionResult holds aggregated results from RunDeletionProgress.

func RunDeletionProgress

func RunDeletionProgress(w io.Writer, items []scanner.ScanResult, deleteFn func(string) (int64, error)) DeletionResult

RunDeletionProgress deletes each item via deleteFn, showing a progress bar on w. Falls back to a plain loop when w is not a TTY.

type PickerModel

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

PickerModel is a bubbletea model for multi-select item picking.

func NewPickerModel

func NewPickerModel(items []scanner.ScanResult) PickerModel

NewPickerModel returns a PickerModel ready to display items.

func (PickerModel) Confirmed

func (m PickerModel) Confirmed() bool

Confirmed reports whether the user pressed Enter to confirm their selection.

func (PickerModel) Init

func (m PickerModel) Init() tea.Cmd

func (PickerModel) ItemCount

func (m PickerModel) ItemCount() int

ItemCount returns the total number of items in the picker.

func (PickerModel) SelectedCount

func (m PickerModel) SelectedCount() int

SelectedCount returns the number of currently selected items.

func (PickerModel) SelectedResults

func (m PickerModel) SelectedResults() []scanner.ScanResult

SelectedResults returns the scan results the user selected.

func (PickerModel) Update

func (m PickerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (PickerModel) View

func (m PickerModel) View() string

Jump to

Keyboard shortcuts

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