tui

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Overview

Package tui provides a terminal user interface for Copa using progrock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatEmulationPrefix

func FormatEmulationPrefix(hostArch, targetArch, targetVariant string) string

FormatEmulationPrefix formats a platform prefix showing host→target when using QEMU emulation. Returns "arm64" for native builds, or "amd64 → arm64" (unicode) / "amd64 -> arm64" (ASCII) for emulated builds.

func RenderError

func RenderError(info ErrorInfo) string

RenderError renders an error message with colors.

func RenderNextSteps

func RenderNextSteps(steps NextSteps) string

RenderNextSteps renders next steps with colors.

func RenderPatchSummary

func RenderPatchSummary(summaries []PlatformSummary) string

RenderPatchSummary renders a summary of patched platforms with colors.

func RenderPatchingPlan

func RenderPatchingPlan(plan PatchingPlan) string

RenderPatchingPlan renders the patching plan with colors.

Types

type Display

type Display interface {
	UpdateFrom(ctx context.Context, ch chan *client.SolveStatus) ([]client.VertexWarning, error)
}

Display wraps either progrock or standard progressui based on debug mode.

func NewDisplay

func NewDisplay(output *os.File, debugMode bool, progress progressui.DisplayMode) (Display, error)

NewDisplay creates a new display interface. Uses progrock TUI when progress mode is auto/tty and we have a TTY. Falls back to BuildKit's progressui for explicit modes (plain, quiet, rawjson) or debug mode.

func NewProgrockDisplay

func NewProgrockDisplay(output *os.File) (Display, error)

NewProgrockDisplay creates a progrock-based display.

type ErrorInfo

type ErrorInfo struct {
	Title   string
	Message string
	Hint    string
}

ErrorInfo contains information about an error to display.

type NextSteps

type NextSteps struct {
	PushCommands    []string
	ManifestCommand string
	SuccessMessage  string
}

NextSteps represents the next steps to display after patching.

type PatchingPlan

type PatchingPlan struct {
	TargetPlatform     string
	PatchedImageName   string
	PreservedPlatforms []string
}

PatchingPlan represents the patching plan to display.

type PlatformSummary

type PlatformSummary struct {
	Platform string
	Status   string
	Ref      string
	Message  string
}

PlatformSummary represents the summary for a single platform.

Jump to

Keyboard shortcuts

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