tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package tui provides terminal user interface components and callbacks for git-vendor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskToOverrideCompliance

func AskToOverrideCompliance(license string) bool

AskToOverrideCompliance prompts the user to override license compliance check.

func PrintComplianceSuccess

func PrintComplianceSuccess(license string)

PrintComplianceSuccess displays a license compliance success message.

func PrintError

func PrintError(title, msg string)

PrintError displays an error message with styling to the terminal.

func PrintHelp

func PrintHelp()

PrintHelp displays usage information for git-vendor commands.

func PrintInfo

func PrintInfo(msg string)

PrintInfo displays an informational message to the terminal.

func PrintSuccess

func PrintSuccess(msg string)

PrintSuccess displays a success message with styling to the terminal.

func PrintWarning

func PrintWarning(title, msg string)

PrintWarning displays a warning message with styling to the terminal.

func RunAddWizard

func RunAddWizard(mgr interface{}, existingVendors map[string]types.VendorSpec) *types.VendorSpec

RunAddWizard launches the interactive wizard for adding a new vendor dependency.

func RunEditVendorWizard

func RunEditVendorWizard(mgr interface{}, vendor *types.VendorSpec) *types.VendorSpec

RunEditVendorWizard launches the interactive wizard for editing an existing vendor.

func RunEditWizardName

func RunEditWizardName(vendorNames []string) string

RunEditWizardName prompts the user to select a vendor to edit from the list.

func ShowConflictWarnings

func ShowConflictWarnings(mgr VendorManager, vendorName string)

ShowConflictWarnings displays any path conflicts involving the given vendor

func StyleTitle

func StyleTitle(text string) string

StyleTitle applies title styling to the given text string.

Types

type BubbletaeProgressTracker

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

BubbletaeProgressTracker manages progress using bubbletea

func NewBubbletaeProgressTracker

func NewBubbletaeProgressTracker(total int, label string) *BubbletaeProgressTracker

NewBubbletaeProgressTracker creates a new bubbletea progress tracker

func (*BubbletaeProgressTracker) Complete

func (t *BubbletaeProgressTracker) Complete()

Complete marks the operation as complete.

func (*BubbletaeProgressTracker) Fail

func (t *BubbletaeProgressTracker) Fail(err error)

Fail marks the operation as failed with an error.

func (*BubbletaeProgressTracker) Increment

func (t *BubbletaeProgressTracker) Increment(message string)

Increment updates progress with a message.

func (*BubbletaeProgressTracker) SetTotal

func (t *BubbletaeProgressTracker) SetTotal(total int)

SetTotal sets the total count for the progress tracker.

type NoOpProgressTracker

type NoOpProgressTracker struct{}

NoOpProgressTracker does nothing (for quiet/JSON/testing modes)

func NewNoOpProgressTracker

func NewNoOpProgressTracker() *NoOpProgressTracker

NewNoOpProgressTracker creates a new no-op progress tracker

func (*NoOpProgressTracker) Complete

func (t *NoOpProgressTracker) Complete()

Complete does nothing (no-op implementation).

func (*NoOpProgressTracker) Fail

func (t *NoOpProgressTracker) Fail(_ error)

Fail does nothing (no-op implementation).

func (*NoOpProgressTracker) Increment

func (t *NoOpProgressTracker) Increment(_ string)

Increment does nothing (no-op implementation).

func (*NoOpProgressTracker) SetTotal

func (t *NoOpProgressTracker) SetTotal(_ int)

SetTotal does nothing (no-op implementation).

type NonInteractiveTUICallback

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

NonInteractiveTUICallback handles non-interactive mode output

func NewNonInteractiveTUICallback

func NewNonInteractiveTUICallback(flags core.NonInteractiveFlags) *NonInteractiveTUICallback

NewNonInteractiveTUICallback creates a new non-interactive callback

func (*NonInteractiveTUICallback) AskConfirmation

func (n *NonInteractiveTUICallback) AskConfirmation(title, message string) bool

AskConfirmation handles confirmation prompts

func (*NonInteractiveTUICallback) FormatJSON

func (n *NonInteractiveTUICallback) FormatJSON(output core.JSONOutput) error

FormatJSON formats and outputs JSON to stdout

func (*NonInteractiveTUICallback) GetOutputMode

func (n *NonInteractiveTUICallback) GetOutputMode() core.OutputMode

GetOutputMode returns the current output mode

func (*NonInteractiveTUICallback) IsAutoApprove

func (n *NonInteractiveTUICallback) IsAutoApprove() bool

IsAutoApprove returns whether auto-approve is enabled

func (*NonInteractiveTUICallback) ShowError

func (n *NonInteractiveTUICallback) ShowError(title, message string)

ShowError displays an error message

func (*NonInteractiveTUICallback) ShowLicenseCompliance

func (n *NonInteractiveTUICallback) ShowLicenseCompliance(license string)

ShowLicenseCompliance displays license compliance information

func (*NonInteractiveTUICallback) ShowSuccess

func (n *NonInteractiveTUICallback) ShowSuccess(message string)

ShowSuccess displays a success message

func (*NonInteractiveTUICallback) ShowWarning

func (n *NonInteractiveTUICallback) ShowWarning(title, message string)

ShowWarning displays a warning message

func (*NonInteractiveTUICallback) StartProgress

func (n *NonInteractiveTUICallback) StartProgress(total int, label string) types.ProgressTracker

StartProgress creates appropriate progress tracker based on output mode

func (*NonInteractiveTUICallback) StyleTitle

func (n *NonInteractiveTUICallback) StyleTitle(title string) string

StyleTitle returns a styled title (no styling in non-interactive mode)

type TUICallback

type TUICallback struct{}

TUICallback implements UICallback for interactive terminal use with styled output.

func NewTUICallback

func NewTUICallback() *TUICallback

NewTUICallback creates a new interactive terminal UI callback.

func (*TUICallback) AskConfirmation

func (t *TUICallback) AskConfirmation(title, message string) bool

AskConfirmation prompts the user for yes/no confirmation.

func (*TUICallback) FormatJSON

func (t *TUICallback) FormatJSON(_ core.JSONOutput) error

FormatJSON is not used in interactive mode

func (*TUICallback) GetOutputMode

func (t *TUICallback) GetOutputMode() core.OutputMode

GetOutputMode returns the output mode (normal for interactive TUI)

func (*TUICallback) IsAutoApprove

func (t *TUICallback) IsAutoApprove() bool

IsAutoApprove returns whether auto-approve is enabled (always false for interactive mode)

func (*TUICallback) ShowError

func (t *TUICallback) ShowError(title, message string)

ShowError displays an error message with confirmation dialog.

func (*TUICallback) ShowLicenseCompliance

func (t *TUICallback) ShowLicenseCompliance(license string)

ShowLicenseCompliance displays license verification information.

func (*TUICallback) ShowSuccess

func (t *TUICallback) ShowSuccess(message string)

ShowSuccess displays a success message with styled output.

func (*TUICallback) ShowWarning

func (t *TUICallback) ShowWarning(title, message string)

ShowWarning displays a warning message with styled output.

func (*TUICallback) StartProgress

func (t *TUICallback) StartProgress(total int, label string) types.ProgressTracker

StartProgress creates a progress tracker (bubbletea for TTY, text for non-TTY)

func (*TUICallback) StyleTitle

func (t *TUICallback) StyleTitle(title string) string

StyleTitle returns a styled title string for terminal output.

type TextProgressTracker

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

TextProgressTracker provides simple text-based progress

func NewTextProgressTracker

func NewTextProgressTracker(total int, label string) *TextProgressTracker

NewTextProgressTracker creates a new text progress tracker

func (*TextProgressTracker) Complete

func (t *TextProgressTracker) Complete()

Complete marks the operation as complete.

func (*TextProgressTracker) Fail

func (t *TextProgressTracker) Fail(err error)

Fail marks the operation as failed with an error.

func (*TextProgressTracker) Increment

func (t *TextProgressTracker) Increment(message string)

Increment updates progress with a message.

func (*TextProgressTracker) SetTotal

func (t *TextProgressTracker) SetTotal(total int)

SetTotal sets the total count for the progress tracker.

type VendorManager

type VendorManager interface {
	ParseSmartURL(string) (string, string, string)
	FetchRepoDir(string, string, string) ([]string, error)
	ListLocalDir(string) ([]string, error)
	GetLockHash(vendorName, ref string) string
	DetectConflicts() ([]types.PathConflict, error)
}

VendorManager defines the interface for vendor management operations used by the wizard.

Jump to

Keyboard shortcuts

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