Documentation
¶
Index ¶
- func PrintDeletionSummary(w io.Writer, freed int64, count int)
- func PrintJSON(w io.Writer, results []scanner.ScanResult) error
- func PrintTable(w io.Writer, results []scanner.ScanResult) error
- func RunPicker(w io.Writer, items []scanner.ScanResult) ([]scanner.ScanResult, error)
- func RunWithSpinner[T any](w io.Writer, label string, fn func() T) T
- type DeletionResult
- type PickerModel
- func (m PickerModel) Confirmed() bool
- func (m PickerModel) Init() tea.Cmd
- func (m PickerModel) ItemCount() int
- func (m PickerModel) SelectedCount() int
- func (m PickerModel) SelectedResults() []scanner.ScanResult
- func (m PickerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m PickerModel) View() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Types ¶
type DeletionResult ¶
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) View ¶
func (m PickerModel) View() string