output

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package output provides output handling and formatting for batch operations.

Index

Constants

View Source
const (
	// TUI is the terminal UI output style
	TUI = "tui"
	// Native is the native output style
	Native = "native"
)

Variables

View Source
var AvailableStyles = []string{TUI, Native}

AvailableStyles lists all supported output styles

Functions

func NativeCatalog

func NativeCatalog(cmd *cobra.Command)

NativeCatalog displays the repository catalog in a simple text format.

func NativeHandler

func NativeHandler(cmd *cobra.Command, channels []Channel)

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

func NativeLabels(cmd *cobra.Command, verbose bool, filters ...string)

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

func TUICatalog(cmd *cobra.Command)

TUICatalog displays the repository catalog using a TUI for an interactive experience.

func TUIHandler

func TUIHandler(cmd *cobra.Command, channels []Channel)

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.

func TUILabels

func TUILabels(cmd *cobra.Command, verbose bool, filters ...string)

TUILabels displays labels using a TUI for an interactive experience. When no filters are provided, it displays all available labels with their repositories. When filters are provided, it displays a concise set-theory representation with matched repos.

Types

type CatalogHandler

type CatalogHandler func(cmd *cobra.Command)

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

func NewChannel

func NewChannel(ctx context.Context, name string, sem *semaphore.Weighted, wg *sync.WaitGroup) Channel

NewChannel creates a new output channel with the given context, name, semaphore, and wait group

type Handler

type Handler func(cmd *cobra.Command, channels []Channel)

Handler represents a function for processing streaming command output.

func GetHandler

func GetHandler(ctx context.Context) Handler

GetHandler returns an output Handler based on the configuration.

type LabelHandler

type LabelHandler func(cmd *cobra.Command, verbose bool, filters ...string)

LabelHandler represents a function for displaying labels.

func GetLabelHandler

func GetLabelHandler(ctx context.Context) LabelHandler

GetLabelHandler returns a LabelHandler based on the configuration.

Jump to

Keyboard shortcuts

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