tui

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tui provides an interactive terminal user interface for Indago.

Package tui provides an interactive terminal user interface for Indago.

Package tui provides an interactive terminal user interface for Indago.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInteractive

func RunInteractive() error

RunInteractive runs the TUI with simulated data for testing.

func SeverityColor

func SeverityColor(severity string) lipgloss.Color

SeverityColor returns the lipgloss color for a severity level.

Types

type Model

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

Model represents the TUI application state.

func NewModel

func NewModel() *Model

NewModel creates a new TUI model.

func (*Model) GetTriageDecisions

func (m *Model) GetTriageDecisions() map[int]string

GetTriageDecisions returns the triage decisions made.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) SetChannels

func (m *Model) SetChannels(progress <-chan ProgressUpdate, findings <-chan types.Finding, done <-chan struct{}, pause chan<- bool)

SetChannels sets the communication channels for the model.

func (*Model) SetScanState

func (m *Model) SetScanState(state ScanState)

SetScanState updates the scan state.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Model) View

func (m *Model) View() string

View implements tea.Model.

type ProgressUpdate

type ProgressUpdate struct {
	TotalEndpoints   int
	ScannedEndpoints int
	TotalRequests    int
	CompletedReqs    int
	CurrentEndpoint  string
	RequestsPerSec   float64
}

ProgressUpdate represents a progress update from the scanner.

type Runner

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

Runner manages the TUI lifecycle and integration with the scanner.

func NewRunner

func NewRunner() *Runner

NewRunner creates a new TUI runner.

func (*Runner) GetPauseChannel

func (r *Runner) GetPauseChannel() <-chan bool

GetPauseChannel returns the pause control channel.

func (*Runner) GetTriageDecisions

func (r *Runner) GetTriageDecisions() map[int]string

GetTriageDecisions returns the triage decisions made by the user.

func (*Runner) SendFinding

func (r *Runner) SendFinding(finding types.Finding)

SendFinding sends a finding to the TUI.

func (*Runner) SendProgress

func (r *Runner) SendProgress(update ProgressUpdate)

SendProgress sends a progress update to the TUI.

func (*Runner) SignalDone

func (r *Runner) SignalDone()

SignalDone signals that the scan is complete.

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) error

Start initializes and runs the TUI.

func (*Runner) Stop

func (r *Runner) Stop()

Stop stops the TUI.

type ScanState

type ScanState int

ScanState represents the state of the scan.

const (
	StateIdle ScanState = iota
	StateRunning
	StatePaused
	StateComplete
	StateError
)

type StyledView

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

StyledView provides styled rendering methods.

func NewStyledView

func NewStyledView(model *Model) *StyledView

NewStyledView creates a new styled view.

func (*StyledView) RenderFinding

func (v *StyledView) RenderFinding(f types.Finding, selected bool) string

RenderFinding renders a single finding with appropriate severity styling.

func (*StyledView) RenderFindingDetail

func (v *StyledView) RenderFindingDetail(f types.Finding) string

RenderFindingDetail renders detailed finding information.

func (*StyledView) RenderFooter

func (v *StyledView) RenderFooter() string

RenderFooter renders the styled footer.

func (*StyledView) RenderHeader

func (v *StyledView) RenderHeader() string

RenderHeader renders a styled header.

func (*StyledView) RenderHelp

func (v *StyledView) RenderHelp() string

RenderHelp renders styled help text.

func (*StyledView) RenderProgressBar

func (v *StyledView) RenderProgressBar(label string, current, total int, width int) string

RenderProgressBar renders a styled progress bar.

func (*StyledView) RenderStats

func (v *StyledView) RenderStats() string

RenderStats renders scan statistics.

func (*StyledView) RenderStatus

func (v *StyledView) RenderStatus() string

RenderStatus renders the scan status with appropriate styling.

type ViewMode

type ViewMode int

ViewMode represents the current view in the TUI.

const (
	ViewProgress ViewMode = iota
	ViewFindings
	ViewTriage
	ViewHelp
)

Jump to

Keyboard shortcuts

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