Documentation
¶
Overview ¶
Package output provides output handling and formatting for batch operations.
Index ¶
- Constants
- Variables
- func NativeCatalog(cmd *cobra.Command)
- func NativeHandler(cmd *cobra.Command, channels []Channel)
- func NativeLabels(cmd *cobra.Command, verbose bool, filters ...string)
- func TUICatalog(cmd *cobra.Command)
- func TUIHandler(cmd *cobra.Command, channels []Channel)
- func TUILabels(cmd *cobra.Command, verbose bool, filters ...string)
- type CatalogHandler
- type Channel
- type Handler
- type LabelHandler
Constants ¶
const ( // TUI is the terminal UI output style TUI = "tui" // Native is the native output style Native = "native" )
Variables ¶
var AvailableStyles = []string{TUI, Native}
AvailableStyles lists all supported output styles
Functions ¶
func NativeCatalog ¶
NativeCatalog displays the repository catalog in a simple text format.
func NativeHandler ¶
NativeHandler is a simple output Handler that batches and prints output from each repository's channels in sequence. It is straightforward and compatible with all terminal environments, but lacks interactivity and modern UI features.
func NativeLabels ¶
NativeLabels prints labels in the native/terminal output format. When no filters are provided, it prints all available labels and their repositories. When filters are provided, it prints a set-theory representation of the filter and matched repos.
func TUICatalog ¶
TUICatalog displays the repository catalog using a TUI for an interactive experience.
func TUIHandler ¶
TUIHandler is an OutputHandler that uses a TUI to provide a modern, interactive interface. It displays repository progress with styled output, real-time updates, and a cleaner visual presentation.
Types ¶
type CatalogHandler ¶
CatalogHandler represents a function for displaying the repository catalog.
func GetCatalogHandler ¶
func GetCatalogHandler(ctx context.Context) CatalogHandler
GetCatalogHandler returns a CatalogHandler based on the configuration.
type Channel ¶
type Channel interface {
// Name returns the name of the channel.
Name() string
// Out returns the output channel for reading.
Out() <-chan []byte
// Err returns the error channel for reading.
Err() <-chan error
// WriteString writes a whole line to the output channel as a string.
io.StringWriter
// Write bytes directly to the output channel.
io.Writer
// WriteError writes an error to the error channel.
WriteError(err error)
// Start begins processing with the specified weight for semaphore acquisition.
Start(weight int64) error
// Close the channels and release any acquired semaphore. If a wait group is
// provided it will be decremented.
io.Closer
}
Channel represents an output channel for concurrent operations
type Handler ¶
Handler represents a function for processing streaming command output.
func GetHandler ¶
GetHandler returns an output Handler based on the configuration.
type LabelHandler ¶
LabelHandler represents a function for displaying labels.
func GetLabelHandler ¶
func GetLabelHandler(ctx context.Context) LabelHandler
GetLabelHandler returns a LabelHandler based on the configuration.