Documentation
¶
Overview ¶
Package terminal provides colored output and progress display
Index ¶
- Constants
- type AnalyzerResultRow
- type ScanFindings
- type Terminal
- func (t *Terminal) AnalyzerResultsTable(rows []AnalyzerResultRow)
- func (t *Terminal) AnalyzerRunning(name string, estimate int)
- func (t *Terminal) Box(text string)
- func (t *Terminal) ClearLine()
- func (t *Terminal) Color(code, text string) string
- func (t *Terminal) Confirm(prompt string, defaultYes bool) bool
- func (t *Terminal) Divider()
- func (t *Terminal) Error(format string, args ...interface{})
- func (t *Terminal) Header(text string)
- func (t *Terminal) Info(format string, args ...interface{})
- func (t *Terminal) LogScannerStatus(name string, status string)
- func (t *Terminal) Progress(completed, total int, active string)
- func (t *Terminal) PromptChoice(prompt string, options []string, defaultOption int) int
- func (t *Terminal) RepoCloned(name, size, files, commit, status string)
- func (t *Terminal) RepoComplete(name string, success bool)
- func (t *Terminal) RepoScanning(name string, estimate int)
- func (t *Terminal) ScanComplete()
- func (t *Terminal) ScannerComplete(name, summary string, duration int)
- func (t *Terminal) ScannerFailed(name, errMsg string, duration int)
- func (t *Terminal) ScannerQueued(name string, estimate int)
- func (t *Terminal) ScannerSkipped(name string)
- func (t *Terminal) SubHeader(text string)
- func (t *Terminal) Success(format string, args ...interface{})
- func (t *Terminal) Summary(org string, duration int, success, failed int, diskUsage, files string)
- func (t *Terminal) SummaryWithFindings(org string, duration int, success, failed int, diskUsage, files string, ...)
- func (t *Terminal) UpdateScannerStatus(linesUp int, name string, status string, icon string, color string, ...)
- func (t *Terminal) Warn(format string, args ...interface{})
- func (t *Terminal) Warning(format string, args ...interface{})
Constants ¶
const ( Reset = "\033[0m" Bold = "\033[1m" Dim = "\033[2m" Red = "\033[0;31m" Green = "\033[0;32m" Yellow = "\033[1;33m" Blue = "\033[0;34m" Cyan = "\033[0;36m" White = "\033[0;37m" BoldRed = "\033[1;31m" BoldGreen = "\033[1;32m" )
ANSI color codes
const ( IconSuccess = "✓" IconFailed = "✗" IconRunning = "◐" IconQueued = "○" IconSkipped = "⊘" IconWarning = "⚠" IconArrow = "▸" )
Icons for status display
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzerResultRow ¶
type AnalyzerResultRow struct {
Name string
Status string // "success", "failed", "skipped"
Summary string
Duration time.Duration
}
AnalyzerResultRow represents a row in the scanner results table
type ScanFindings ¶
type ScanFindings struct {
// Scanners that were run (used to conditionally show sections)
ScannersRun map[string]bool
// SBOM
SBOMPath string // Path to generated SBOM file(s)
SBOMPaths []string // Multiple SBOM paths for multi-repo scans
SBOMSizeTotal int64 // Total size of all SBOM files in bytes
// Packages
TotalPackages int
PackagesByEco map[string]int
// Vulnerabilities
VulnCritical int
VulnHigh int
VulnMedium int
VulnLow int
VulnsByEco map[string]int
// Licenses
LicenseTypes int
LicenseCounts map[string]int
// Secrets
SecretsCritical int
SecretsHigh int
SecretsMedium int
SecretsTotal int
// Malcontent
MalcontentCrit int
MalcontentHigh int
// Health
HealthCritical int
HealthWarnings int
// Tech-ID (Technology Detection)
TechTotalTechs int // Total unique technologies detected
TechByCategory map[string]int // Technologies by category (language, framework, etc.)
TechTopList []string // Top technologies across all repos
TechMLModels int // ML models detected
TechMLFrameworks int // AI/ML frameworks detected
TechSecurityCount int // Security findings from AI/ML analysis
}
ScanFindings holds aggregated scan findings
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal provides thread-safe terminal output
func (*Terminal) AnalyzerResultsTable ¶
func (t *Terminal) AnalyzerResultsTable(rows []AnalyzerResultRow)
AnalyzerResultsTable prints a table of scanner results
func (*Terminal) AnalyzerRunning ¶
AnalyzerRunning prints a running scanner line
func (*Terminal) LogScannerStatus ¶
LogScannerStatus logs a scanner status message on a new line (doesn't update in place)
func (*Terminal) PromptChoice ¶
PromptChoice asks user to select from options
func (*Terminal) RepoCloned ¶
RepoCloned prints a cloned repo result
func (*Terminal) RepoComplete ¶
RepoComplete prints a completed repo header
func (*Terminal) RepoScanning ¶
RepoScanning prints a repo that's being scanned
func (*Terminal) ScanComplete ¶
func (t *Terminal) ScanComplete()
ScanComplete prints the final scanning complete message
func (*Terminal) ScannerComplete ¶
ScannerComplete prints a completed scanner result
func (*Terminal) ScannerFailed ¶
ScannerFailed prints a failed scanner result
func (*Terminal) ScannerQueued ¶
ScannerQueued prints a queued scanner line
func (*Terminal) ScannerSkipped ¶
ScannerSkipped prints a skipped scanner line
func (*Terminal) SummaryWithFindings ¶
func (t *Terminal) SummaryWithFindings(org string, duration int, success, failed int, diskUsage, files string, findings *ScanFindings)
SummaryWithFindings prints the hydrate summary with aggregated findings
func (*Terminal) UpdateScannerStatus ¶
func (t *Terminal) UpdateScannerStatus(linesUp int, name string, status string, icon string, color string, extra string)
UpdateScannerStatus updates a scanner line in place (moves cursor up and rewrites)