display

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Display

type Display interface {
	// Initialize the display
	Init(ctx context.Context) error

	// Start displaying execution
	Start(plan *config.ExecutionPlan) error

	// Update progress
	UpdateProgress(progress *ExecutionProgress) error

	// Update step status
	UpdateStep(stepID string, status StepStatus, message string) error

	// Show error
	ShowError(stepID string, err error) error

	// Show output from executors
	ShowOutput(stepID string, output string) error

	// Finish execution
	Finish(success bool, summary string) error

	// Close the display
	Close() error
}

Display is the interface for rendering execution progress

func NewDisplay

func NewDisplay(mode DisplayMode, verbose bool) Display

Factory creates a new Display instance based on mode

type DisplayMode

type DisplayMode string

DisplayMode represents the output mode

const (
	ModeSimple      DisplayMode = "simple"      // Simple text output
	ModeInteractive DisplayMode = "interactive" // Future TUI mode
	ModeJSON        DisplayMode = "json"        // JSON output for CI/CD
)

type ExecutionProgress

type ExecutionProgress struct {
	Plan            *config.ExecutionPlan
	TotalSteps      int
	CompletedSteps  int
	CurrentStep     string
	StartTime       time.Time
	ElapsedTime     time.Duration
	EstimatedTime   time.Duration
	Steps           []StepProgress
	CurrentActivity string
	Error           error
}

ExecutionProgress represents the current execution state

type FileProgress

type FileProgress struct {
	Path     string
	Status   StepStatus
	Error    error
	Output   string
	Duration time.Duration
}

FileProgress represents progress of a single file execution

type ProgressTracker

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

ProgressTracker provides progress information to displays

func NewProgressTracker

func NewProgressTracker(plan *config.ExecutionPlan, state *core.ExecutionState, display Display) *ProgressTracker

NewProgressTracker creates a new progress tracker

func (*ProgressTracker) Finish

func (pt *ProgressTracker) Finish(success bool) error

Finish completes tracking

func (*ProgressTracker) Output

func (pt *ProgressTracker) Output(stepID string, output string) error

Output shows output from a step

func (*ProgressTracker) SetState

func (pt *ProgressTracker) SetState(state *core.ExecutionState)

SetState updates the state reference

func (*ProgressTracker) Start

func (pt *ProgressTracker) Start() error

Start begins tracking

func (*ProgressTracker) StepCompleted

func (pt *ProgressTracker) StepCompleted(stepID string, duration time.Duration) error

StepCompleted notifies that a step has completed

func (*ProgressTracker) StepFailed

func (pt *ProgressTracker) StepFailed(stepID string, err error) error

StepFailed notifies that a step has failed

func (*ProgressTracker) StepSkipped

func (pt *ProgressTracker) StepSkipped(stepID string, reason string) error

StepSkipped notifies that a step was skipped

func (*ProgressTracker) StepStarted

func (pt *ProgressTracker) StepStarted(stepID string) error

StepStarted notifies that a step has started

func (*ProgressTracker) Update

func (pt *ProgressTracker) Update() error

Update updates the current progress

type StepProgress

type StepProgress struct {
	ID           string
	Description  string
	Status       StepStatus
	StartTime    *time.Time
	Duration     time.Duration
	Error        error
	Dependencies []string
	Files        []FileProgress
}

StepProgress represents progress of a single step

type StepStatus

type StepStatus string

StepStatus represents the current status of a step

const (
	StatusPending   StepStatus = "pending"
	StatusRunning   StepStatus = "running"
	StatusCompleted StepStatus = "completed"
	StatusFailed    StepStatus = "failed"
	StatusSkipped   StepStatus = "skipped"
)

type TerminalDisplay

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

TerminalDisplay implements Display for simple terminal output

func NewTerminalDisplay

func NewTerminalDisplay(verbose bool) *TerminalDisplay

NewTerminalDisplay creates a new terminal display

func (*TerminalDisplay) Close

func (td *TerminalDisplay) Close() error

Close closes the display

func (*TerminalDisplay) Finish

func (td *TerminalDisplay) Finish(success bool, summary string) error

Finish completes the display

func (*TerminalDisplay) Init

func (td *TerminalDisplay) Init(ctx context.Context) error

Init initializes the display

func (*TerminalDisplay) ShowError

func (td *TerminalDisplay) ShowError(stepID string, err error) error

ShowError displays an error

func (*TerminalDisplay) ShowOutput

func (td *TerminalDisplay) ShowOutput(stepID string, output string) error

ShowOutput displays output from executors

func (*TerminalDisplay) Start

func (td *TerminalDisplay) Start(plan *config.ExecutionPlan) error

Start begins display

func (*TerminalDisplay) UpdateProgress

func (td *TerminalDisplay) UpdateProgress(progress *ExecutionProgress) error

UpdateProgress updates the progress display

func (*TerminalDisplay) UpdateStep

func (td *TerminalDisplay) UpdateStep(stepID string, status StepStatus, message string) error

UpdateStep updates a step's status

Jump to

Keyboard shortcuts

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