tui

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package tui renders interactive and text progress for CLI operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(output io.Writer, title string, run func(Progress) error, initial ...Event) error

Run renders progress while run executes, seeded with known transfers.

Types

type Event

type Event struct {
	Type    EventType
	Name    string
	Message string
	Current int64
	Total   int64
	Err     error
}

Event reports progress for one item.

type EventType

type EventType string

EventType describes one operation lifecycle transition.

const (
	// Status reports the current operation phase.
	Status EventType = "status"
	// Checking marks an item whose cache is being checked.
	Checking EventType = "checking"
	// Cached marks an item already available locally.
	Cached EventType = "cached"
	// Queued marks an item waiting to transfer.
	Queued EventType = "queued"
	// Started marks an active transfer.
	Started EventType = "started"
	// Progressed updates an active transfer's byte count.
	Progressed EventType = "progress"
	// Done marks a completed transfer.
	Done EventType = "done"
	// Failed marks a failed transfer.
	Failed EventType = "failed"
)

type Progress

type Progress func(Event)

Progress receives operation events.

Jump to

Keyboard shortcuts

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