Documentation
¶
Index ¶
- Constants
- func PrintError(msg string)
- func PrintInfo(msg string)
- func PrintRunDir(runDir string)
- func PrintSkipped(msg string)
- func PrintStep(step, total int, title, description string)
- func PrintSuccess(msg string)
- func PrintWarning(msg string)
- func RenderFailureSummary(failures []ScanFailure, totalPackages int)
- func RenderInspectTable(rows []PostInstallRow)
- func RenderPackageTable(rows []PackageRow)
- func RenderPostInstallTable(rows []PostInstallRow, showLLM bool)
- func RenderPreInstallTable(rows []PreInstallRow, showLLM bool)
- func RenderSummary(updated, failed int, cvesResolved, cvesRemaining int)
- type InteractiveSelector
- type PackageItem
- type PackageRow
- type PostInstallRow
- type PreInstallRow
- type Progress
- type Prompter
- func (p *Prompter) Confirm(question string, defaultYes bool) (bool, error)
- func (p *Prompter) ConfirmPackageUpgrade(pkg string, verdict llm.Verdict, reason string) (bool, error)
- func (p *Prompter) SelectPackagesInteractive(items []PackageItem) ([]string, error)
- func (p *Prompter) WaitForEnterOrEsc() bool
- type ScanFailure
- type Severity
- type SignalHandler
Constants ¶
const ( ColorReset = "\033[0m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorCyan = "\033[36m" ColorBold = "\033[1m" )
Color codes for terminal output
Variables ¶
This section is empty.
Functions ¶
func PrintSkipped ¶
func PrintSkipped(msg string)
PrintSkipped prints a skipped/not applicable message
func RenderFailureSummary ¶
func RenderFailureSummary(failures []ScanFailure, totalPackages int)
RenderFailureSummary displays failures at the end of the workflow
func RenderInspectTable ¶
func RenderInspectTable(rows []PostInstallRow)
RenderInspectTable displays inspect results (vulnerability scan only).
func RenderPackageTable ¶
func RenderPackageTable(rows []PackageRow)
RenderPackageTable displays the package status table (Step 2)
func RenderPostInstallTable ¶
func RenderPostInstallTable(rows []PostInstallRow, showLLM bool)
RenderPostInstallTable displays the post-install summary (Step 6). Columns shown: Package, LLM verdict (if enabled), Overall.
func RenderPreInstallTable ¶
func RenderPreInstallTable(rows []PreInstallRow, showLLM bool)
RenderPreInstallTable displays pre-install scan results (Step 4)
func RenderSummary ¶
RenderSummary displays the final summary
Types ¶
type InteractiveSelector ¶
type InteractiveSelector struct {
// contains filtered or unexported fields
}
InteractiveSelector provides an interactive package selection UI
func NewInteractiveSelector ¶
func NewInteractiveSelector(items []PackageItem) *InteractiveSelector
NewInteractiveSelector creates a new interactive selector. Selection state should already be set on items before calling.
func (*InteractiveSelector) Run ¶
func (s *InteractiveSelector) Run() ([]string, error)
Run displays the interactive selector and returns selected package names
type PackageItem ¶
type PackageItem struct {
Name string
Current string
Latest string
CVECount int
Severity Severity
Pinned bool
Selected bool
Dependents []string // Packages that depend on this one
Dependencies []string // Packages that this one requires
LockedAsDep bool // True if auto-selected because a selected package depends on it
}
PackageItem represents a package in the interactive selector
type PackageRow ¶
type PackageRow struct {
Package string
Current string
Available string
Pinned bool
CVECount int
Severity Severity
Action string
}
PackageRow represents a row in the package table (Step 2)
type PostInstallRow ¶
type PostInstallRow struct {
Package string
Version string
CVECount int
Severity Severity
LLMVerdict llm.Verdict
Overall string
}
PostInstallRow represents a row in the post-install summary (Step 6) and inspect results
type PreInstallRow ¶
type PreInstallRow struct {
Package string
CVECount int
LLMVerdict llm.Verdict
Recommendation string
}
PreInstallRow represents a row in the pre-install scan table (Step 4)
type Progress ¶
type Progress struct {
// contains filtered or unexported fields
}
Progress provides a simple progress indicator for long-running operations
func NewProgress ¶
NewProgress creates a new progress indicator
func (*Progress) Done ¶
func (p *Progress) Done()
Done completes the progress and moves to next line
func (*Progress) SetStatus ¶
SetStatus updates the display without incrementing the counter Use this for showing sub-steps within a single item
type Prompter ¶
type Prompter struct {
// contains filtered or unexported fields
}
Prompter handles user input
func (*Prompter) ConfirmPackageUpgrade ¶
func (p *Prompter) ConfirmPackageUpgrade(pkg string, verdict llm.Verdict, reason string) (bool, error)
ConfirmPackageUpgrade asks for confirmation before upgrading a specific package
func (*Prompter) SelectPackagesInteractive ¶
func (p *Prompter) SelectPackagesInteractive(items []PackageItem) ([]string, error)
SelectPackagesInteractive shows an interactive package selector
func (*Prompter) WaitForEnterOrEsc ¶
WaitForEnterOrEsc waits for Enter (returns true) or Esc (returns false)
type ScanFailure ¶
type ScanFailure struct {
Package string // Package name (empty for non-package-specific failures)
Step string // Which step failed (e.g., "OSV Scan", "LLM Code")
Error string // Error message
}
ScanFailure represents a failure during the workflow
type SignalHandler ¶
type SignalHandler struct {
// contains filtered or unexported fields
}
SignalHandler manages graceful shutdown on CTRL+C
func NewSignalHandler ¶
func NewSignalHandler() *SignalHandler
NewSignalHandler creates a new signal handler
func (*SignalHandler) SetCleanup ¶
func (s *SignalHandler) SetCleanup(fn func())
SetCleanup sets a cleanup function to call on shutdown
func (*SignalHandler) SetInProgress ¶
func (s *SignalHandler) SetInProgress(inProgress bool)
SetInProgress marks that work is in progress (affects prompt message)
func (*SignalHandler) Start ¶
func (s *SignalHandler) Start()
Start begins listening for interrupt signals