ui

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleUsage

func ExampleUsage()

ExampleUsage shows how to use the runner

func GenerateBashCompletionScript

func GenerateBashCompletionScript(rootCmd *cobra.Command) string

BashCompletionScript generates bash completion script

func GenerateZshCompletionScript

func GenerateZshCompletionScript(rootCmd *cobra.Command) string

ZshCompletionScript generates zsh completion script

func InstallCompletions

func InstallCompletions(shell string, rootCmd *cobra.Command) error

InstallCompletions installs shell completions

func RenderBox

func RenderBox(title, content string, width int, boxChars *BoxChars, formatter *Formatter) string

RenderBox renders a box with content

func RenderProgressBar

func RenderProgressBar(current, total int, width int, formatter *Formatter) string

RenderProgressBar renders a colored progress bar

func RenderSeverityBar

func RenderSeverityBar(critical, high, medium, low int, width int, formatter *Formatter) string

RenderSeverityBar renders a colored severity indicator bar

Types

type ActiveScan

type ActiveScan struct {
	ID             string
	Target         string
	Progress       int
	Status         string
	TestsCompleted int
	TestsTotal     int
	FindingsCount  int
	ETA            string
}

type Activity

type Activity struct {
	Time    time.Time
	Type    string
	User    string
	Details string
}

type AdvancedConfig

type AdvancedConfig struct {
	TemplateDir     string                 `yaml:"template_dir"`
	CacheDir        string                 `yaml:"cache_dir"`
	LogLevel        string                 `yaml:"log_level"`
	EnableTelemetry bool                   `yaml:"enable_telemetry"`
	AutoUpdate      bool                   `yaml:"auto_update"`
	Experimental    map[string]interface{} `yaml:"experimental,omitempty"`
}

AdvancedConfig represents advanced settings

type Alert

type Alert struct {
	Level   string
	Message string
	Count   int
}

type AutoCompleter

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

AutoCompleter provides command auto-completion and suggestions

func NewAutoCompleter

func NewAutoCompleter() *AutoCompleter

NewAutoCompleter creates a new auto-completer

func (*AutoCompleter) Complete

func (ac *AutoCompleter) Complete(input string) []string

Complete returns completions for the given input

func (*AutoCompleter) CompleteArgs

func (ac *AutoCompleter) CompleteArgs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteArgs returns argument completions

func (*AutoCompleter) CompleteFlags

func (ac *AutoCompleter) CompleteFlags(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteFlags returns flag completions for cobra command

func (*AutoCompleter) RegisterCommand

func (ac *AutoCompleter) RegisterCommand(cmd *CommandInfo)

RegisterCommand registers a command for auto-completion

type BoxChars

type BoxChars struct {
	TopLeft     string
	TopRight    string
	BottomLeft  string
	BottomRight string
	Horizontal  string
	Vertical    string
	Cross       string
	TeeLeft     string
	TeeRight    string
	TeeTop      string
	TeeBottom   string
}

Box drawing characters

func ASCIIBoxChars

func ASCIIBoxChars() *BoxChars

ASCIIBoxChars returns ASCII box drawing characters

func DefaultBoxChars

func DefaultBoxChars() *BoxChars

DefaultBoxChars returns Unicode box drawing characters

type ColorScheme

type ColorScheme struct {
	// Status colors
	Success *color.Color
	Error   *color.Color
	Warning *color.Color
	Info    *color.Color
	Debug   *color.Color

	// Severity colors for vulnerabilities
	Critical *color.Color
	High     *color.Color
	Medium   *color.Color
	Low      *color.Color

	// UI element colors
	Header    *color.Color
	Subheader *color.Color
	Label     *color.Color
	Value     *color.Color
	Muted     *color.Color

	// Special colors
	Highlight *color.Color
	Link      *color.Color
	Code      *color.Color
	Quote     *color.Color
}

ColorScheme defines colors for different UI elements

func DarkColorScheme

func DarkColorScheme() *ColorScheme

DarkColorScheme returns a color scheme optimized for dark terminals

func DefaultColorScheme

func DefaultColorScheme() *ColorScheme

DefaultColorScheme returns the default color scheme

func LightColorScheme

func LightColorScheme() *ColorScheme

LightColorScheme returns a color scheme optimized for light terminals

type CommandContext

type CommandContext struct {
	LastCommand    string
	LastError      error
	WorkingDir     string
	ActiveProvider string
	LoadedTemplate string
	CurrentScan    string
}

CommandContext tracks current command context

type CommandHistory

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

CommandHistory tracks command usage

type CommandInfo

type CommandInfo struct {
	Name        string
	Description string
	Usage       string
	Aliases     []string
	Flags       []FlagInfo
	SubCommands []*CommandInfo
	Examples    []Example
}

CommandInfo contains command metadata

type CommandSuggester

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

CommandSuggester provides intelligent command suggestions

func NewCommandSuggester

func NewCommandSuggester(terminal *Terminal) *CommandSuggester

NewCommandSuggester creates a new command suggester

func (*CommandSuggester) GetSuggestions

func (cs *CommandSuggester) GetSuggestions() []Suggestion

GetSuggestions returns relevant suggestions based on context

func (*CommandSuggester) RecordCommand

func (cs *CommandSuggester) RecordCommand(command string, success bool, duration time.Duration)

RecordCommand records a command execution

func (*CommandSuggester) ShowSuggestions

func (cs *CommandSuggester) ShowSuggestions()

ShowSuggestions displays suggestions to the user

func (*CommandSuggester) UpdateContext

func (cs *CommandSuggester) UpdateContext(key string, value interface{})

UpdateContext updates command context

type CompactResults

type CompactResults struct {
	ScanID     string
	Duration   string
	TotalTests int
	Critical   int
	High       int
	Medium     int
	Low        int
}

type ComplianceResult

type ComplianceResult struct {
	Standard string
	Coverage float64
	PassRate float64
}

type ComplianceStatus

type ComplianceStatus struct {
	Tested int
	Passed int
	Failed int
}

type ComplianceStatusWidget

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

ComplianceStatusWidget shows compliance mapping

func NewComplianceStatusWidget

func NewComplianceStatusWidget(style *DashboardStyle) *ComplianceStatusWidget

func (*ComplianceStatusWidget) GetTitle

func (w *ComplianceStatusWidget) GetTitle() string

func (*ComplianceStatusWidget) Render

func (w *ComplianceStatusWidget) Render(width, height int) string

func (*ComplianceStatusWidget) Update

func (w *ComplianceStatusWidget) Update(data interface{})

type ConfigWizard

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

ConfigWizard provides interactive configuration setup

func NewConfigWizard

func NewConfigWizard(terminal *Terminal) *ConfigWizard

NewConfigWizard creates a new configuration wizard

func (*ConfigWizard) Run

func (w *ConfigWizard) Run() error

Run executes the configuration wizard

type Configuration

type Configuration struct {
	// Provider settings
	Providers []ProviderConfig `yaml:"providers"`

	// Test settings
	Test TestConfig `yaml:"test"`

	// Output settings
	Output OutputConfig `yaml:"output"`

	// Security settings
	Security SecurityConfig `yaml:"security"`

	// Advanced settings
	Advanced AdvancedConfig `yaml:"advanced"`
}

Configuration represents the tool configuration

type Dashboard

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

Dashboard provides a comprehensive view of scan results

func NewDashboard

func NewDashboard(terminal *Terminal) *Dashboard

NewDashboard creates a new dashboard

func (*Dashboard) ScanDashboard

func (d *Dashboard) ScanDashboard(scanID string) error

ScanDashboard displays real-time scan progress and results

func (*Dashboard) SummaryDashboard

func (d *Dashboard) SummaryDashboard(scanResults *ScanResults) error

SummaryDashboard displays a summary of completed scan results

type DashboardStyle

type DashboardStyle struct {
	Border   lipgloss.Style
	Title    lipgloss.Style
	Widget   lipgloss.Style
	Metric   lipgloss.Style
	Chart    lipgloss.Style
	Critical lipgloss.Style
	Warning  lipgloss.Style
	Success  lipgloss.Style
	Info     lipgloss.Style
}

DashboardStyle defines the visual styling for the dashboard

type DateRange

type DateRange struct {
	Start string
	End   string
}

type DetailedFinding

type DetailedFinding struct {
	Time     time.Time
	Severity string
	Type     string
	Message  string
	TestCase string
}

type Example

type Example struct {
	Command     string
	Description string
}

Example contains command example

type ExportConfig

type ExportConfig struct {
	Format        string
	Filename      string
	OutputPath    string
	OverwriteMode string
	FormatOptions map[string]interface{}
	Filters       ExportFilters
	Redaction     RedactionConfig
}

type ExportConfigurator

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

ExportConfigurator provides interactive export configuration

func NewExportConfigurator

func NewExportConfigurator(terminal *Terminal) *ExportConfigurator

NewExportConfigurator creates a new export configurator

func (*ExportConfigurator) ConfigureExport

func (ec *ExportConfigurator) ConfigureExport(data interface{}) (*ExportConfig, error)

ConfigureExport interactively configures export settings

func (*ExportConfigurator) LoadTemplate

func (ec *ExportConfigurator) LoadTemplate(name string) (*ExportConfig, error)

LoadTemplate loads a saved configuration template

func (*ExportConfigurator) QuickExport

func (ec *ExportConfigurator) QuickExport(preset string, data interface{}) (*ExportConfig, error)

QuickExport provides common export presets

type ExportFilters

type ExportFilters struct {
	Severities            []string
	Categories            []string
	DateRange             DateRange
	IncludeResolved       bool
	IncludeFalsePositives bool
}

type ExportFormat

type ExportFormat struct {
	ID          string
	Name        string
	Description string
	Extensions  []string
	Features    []string
	Compatible  []string
}

type ExportOption

type ExportOption struct {
	Name        string
	Description string
	Default     string
}

type ExportPreview

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

ExportPreview provides preview functionality for different export formats

func NewExportPreview

func NewExportPreview(terminal *Terminal) *ExportPreview

NewExportPreview creates a new export preview handler

func (*ExportPreview) ShowComparisonPreview

func (ep *ExportPreview) ShowComparisonPreview(formats []string, data interface{}) error

ShowComparisonPreview shows a side-by-side format comparison

func (*ExportPreview) ShowFormatSelection

func (ep *ExportPreview) ShowFormatSelection(data interface{}) (string, error)

ShowFormatSelection displays available export formats with previews

func (*ExportPreview) ShowPreview

func (ep *ExportPreview) ShowPreview(formatID string, data interface{}) error

ShowPreview displays a preview of the selected format

type FAQ

type FAQ struct {
	Question string
	Answer   string
	Related  []string
}

FAQ represents a frequently asked question

type Finding

type Finding struct {
	Severity string
	Category string
	Count    int
}

type FlagInfo

type FlagInfo struct {
	Name        string
	Shorthand   string
	Description string
	Type        string
	Default     string
	Required    bool
	Values      []string // Possible values for enum flags
}

FlagInfo contains flag metadata

type Formatter

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

Formatter provides color formatting functions

func NewFormatter

func NewFormatter(scheme *ColorScheme, enabled bool) *Formatter

NewFormatter creates a new formatter

func (*Formatter) Code

func (f *Formatter) Code(code string) string

Code formats code snippets

func (*Formatter) Debug

func (f *Formatter) Debug(format string, args ...interface{}) string

Debug formats debug messages

func (*Formatter) Error

func (f *Formatter) Error(format string, args ...interface{}) string

Error formats error messages

func (*Formatter) Header

func (f *Formatter) Header(text string) string

Header formats headers

func (*Formatter) Highlight

func (f *Formatter) Highlight(text string) string

Highlight formats highlighted text

func (*Formatter) Info

func (f *Formatter) Info(format string, args ...interface{}) string

Info formats info messages

func (*Formatter) Label

func (f *Formatter) Label(text string) string

Label formats labels

func (f *Formatter) Link(url string) string

Link formats links

func (*Formatter) Muted

func (f *Formatter) Muted(format string, args ...interface{}) string

Muted formats muted text

func (*Formatter) Quote

func (f *Formatter) Quote(text string) string

Quote formats quotes

func (*Formatter) Severity

func (f *Formatter) Severity(level string) string

Severity formats severity levels

func (*Formatter) Subheader

func (f *Formatter) Subheader(text string) string

Subheader formats subheaders

func (*Formatter) Success

func (f *Formatter) Success(format string, args ...interface{}) string

Success formats success messages

func (*Formatter) Value

func (f *Formatter) Value(format string, args ...interface{}) string

Value formats values

func (*Formatter) Warning

func (f *Formatter) Warning(format string, args ...interface{}) string

Warning formats warning messages

type HelpContext

type HelpContext struct {
	Command       string
	Subcommand    string
	ErrorContext  string
	LastCommand   string
	UserLevel     string // beginner, intermediate, expert
	PreferredLang string
}

HelpContext represents the current help context

type HelpDoc

type HelpDoc struct {
	Title       string            `yaml:"title"`
	Category    string            `yaml:"category"`
	Tags        []string          `yaml:"tags"`
	Content     string            `yaml:"content"`
	Examples    []HelpExample     `yaml:"examples"`
	Related     []string          `yaml:"related"`
	LastUpdated string            `yaml:"last_updated"`
	Metadata    map[string]string `yaml:"metadata"`
}

HelpDoc represents a help document

type HelpDocManager

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

HelpDocManager manages help documentation

func NewHelpDocManager

func NewHelpDocManager() (*HelpDocManager, error)

NewHelpDocManager creates a new help documentation manager

func (*HelpDocManager) ExportDocs

func (hdm *HelpDocManager) ExportDocs(format, output string) error

ExportDocs exports documentation in various formats

func (*HelpDocManager) GetByCategory

func (hdm *HelpDocManager) GetByCategory(category string) []*HelpDoc

GetByCategory returns all documents in a category

func (*HelpDocManager) GetByTag

func (hdm *HelpDocManager) GetByTag(tag string) []*HelpDoc

GetByTag returns all documents with a specific tag

func (*HelpDocManager) GetRelated

func (hdm *HelpDocManager) GetRelated(docID string) []*HelpDoc

GetRelated returns related documents

func (*HelpDocManager) LoadCustomDocs

func (hdm *HelpDocManager) LoadCustomDocs(dir string) error

LoadCustomDocs loads additional documentation from a directory

func (*HelpDocManager) Search

func (hdm *HelpDocManager) Search(query string) []*HelpDoc

Search performs a full-text search across documentation

type HelpExample

type HelpExample struct {
	Command     string `yaml:"command"`
	Description string `yaml:"description"`
	Output      string `yaml:"output,omitempty"`
}

HelpExample represents a command example for help documentation

type HelpIndex

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

HelpIndex provides full-text search capabilities

type HelpSystem

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

HelpSystem provides context-aware help and documentation

func NewHelpSystem

func NewHelpSystem(terminal *Terminal, suggester *CommandSuggester) *HelpSystem

NewHelpSystem creates a new help system

func (*HelpSystem) ShowHelp

func (hs *HelpSystem) ShowHelp(cmd *cobra.Command, args []string) error

ShowHelp displays context-aware help

func (*HelpSystem) ShowInteractiveHelp

func (hs *HelpSystem) ShowInteractiveHelp() error

ShowInteractiveHelp provides an interactive help experience

type HistoryEntry

type HistoryEntry struct {
	Command   string
	Timestamp time.Time
	Success   bool
	Duration  time.Duration
}

HistoryEntry represents a command in history

type Icons

type Icons struct {
	Success   string
	Error     string
	Warning   string
	Info      string
	Debug     string
	Question  string
	Arrow     string
	Bullet    string
	Check     string
	Cross     string
	Star      string
	Heart     string
	Lightning string
	Fire      string
	Shield    string
	Lock      string
	Key       string
	Globe     string
	Cloud     string
	Database  string
}

Icons provides colored icons

func ASCIIIcons

func ASCIIIcons() *Icons

ASCIIIcons returns ASCII-only icons for compatibility

func DefaultIcons

func DefaultIcons() *Icons

DefaultIcons returns default icon set

type IndexEntry

type IndexEntry struct {
	DocID    string
	Title    string
	Content  string
	Score    float64
	Location string // section within document
}

IndexEntry represents a searchable entry

type InteractiveRunner

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

InteractiveRunner provides interactive task execution

func NewInteractiveRunner

func NewInteractiveRunner(terminal *Terminal, options RunnerOptions) *InteractiveRunner

NewInteractiveRunner creates a new interactive runner

func (*InteractiveRunner) Run

func (ir *InteractiveRunner) Run(ctx context.Context) error

Run executes selected tasks

func (*InteractiveRunner) SelectTasks

func (ir *InteractiveRunner) SelectTasks() error

SelectTasks allows user to interactively select tasks

type InteractiveSuggestions

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

InteractiveSuggestions provides interactive command selection

func NewInteractiveSuggestions

func NewInteractiveSuggestions(suggester *CommandSuggester, terminal *Terminal) *InteractiveSuggestions

NewInteractiveSuggestions creates interactive suggestions

func (*InteractiveSuggestions) ShowAndSelect

func (is *InteractiveSuggestions) ShowAndSelect() (string, bool)

ShowAndSelect shows suggestions and allows selection

type Layout

type Layout struct {
	Rows    []Row
	Columns int
}

Layout manages widget positioning

type LiveMetrics

type LiveMetrics struct {
	ActiveScans       int
	QueuedScans       int
	RequestsPerSecond float64
	AverageLatency    int
	SystemLoad        float64
	MemoryUsage       float64
}

type MiniDashboard

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

MiniDashboard provides compact status views

func NewMiniDashboard

func NewMiniDashboard(terminal *Terminal) *MiniDashboard

NewMiniDashboard creates a new mini dashboard

func (*MiniDashboard) ShowCompactResults

func (md *MiniDashboard) ShowCompactResults(results *CompactResults)

ShowCompactResults displays scan results in a compact format

func (*MiniDashboard) ShowLiveMetrics

func (md *MiniDashboard) ShowLiveMetrics()

ShowLiveMetrics displays real-time metrics

func (*MiniDashboard) ShowQuickStatus

func (md *MiniDashboard) ShowQuickStatus()

ShowQuickStatus displays a quick status overview

func (*MiniDashboard) ShowScanProgress

func (md *MiniDashboard) ShowScanProgress(scan *ActiveScan)

ShowScanProgress displays inline scan progress

func (*MiniDashboard) ShowTestMatrix

func (md *MiniDashboard) ShowTestMatrix(matrix *TestMatrix)

ShowTestMatrix displays a test coverage matrix

type MultiProgress

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

MultiProgress manages multiple concurrent progress indicators

func NewMultiProgress

func NewMultiProgress(output io.Writer, maxTasks int, showDetail bool) *MultiProgress

NewMultiProgress creates a new multi-progress tracker

func (*MultiProgress) AddSubTask

func (mp *MultiProgress) AddSubTask(taskID, name string) error

AddSubTask adds a sub-task to a task

func (*MultiProgress) AddTask

func (mp *MultiProgress) AddTask(id, name string) *Task

AddTask adds a new task to track

func (*MultiProgress) Render

func (mp *MultiProgress) Render() string

Render renders the current progress state

func (*MultiProgress) UpdateTask

func (mp *MultiProgress) UpdateTask(id string, status TaskStatus, progress float64, details string) error

UpdateTask updates task status

type OutputConfig

type OutputConfig struct {
	Formats      []string `yaml:"formats"`
	Directory    string   `yaml:"directory"`
	Filename     string   `yaml:"filename_pattern"`
	Verbose      bool     `yaml:"verbose"`
	ColorOutput  bool     `yaml:"color_output"`
	ShowProgress bool     `yaml:"show_progress"`
}

OutputConfig represents output configuration

type PerformanceMetrics

type PerformanceMetrics struct {
	RequestsPerSecond float64
	AverageLatency    int
	P95Latency        int
	P99Latency        int
	ErrorRate         float64
	Throughput        string
}

type PerformanceMetricsWidget

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

PerformanceMetricsWidget displays performance statistics

func NewPerformanceMetricsWidget

func NewPerformanceMetricsWidget(style *DashboardStyle) *PerformanceMetricsWidget

func (*PerformanceMetricsWidget) GetTitle

func (w *PerformanceMetricsWidget) GetTitle() string

func (*PerformanceMetricsWidget) Render

func (w *PerformanceMetricsWidget) Render(width, height int) string

func (*PerformanceMetricsWidget) Update

func (w *PerformanceMetricsWidget) Update(data interface{})

type ProgressBar

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

ProgressBar represents an individual progress bar

type ProgressManager

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

ProgressManager manages multiple progress indicators

func NewProgressManager

func NewProgressManager(output io.Writer, opts ProgressOptions) *ProgressManager

NewProgressManager creates a new progress manager

func (*ProgressManager) Clear

func (pm *ProgressManager) Clear()

Clear removes all progress bars

func (*ProgressManager) CreateProgressBar

func (pm *ProgressManager) CreateProgressBar(id, description string, total int64) *ProgressBar

CreateProgressBar creates a new progress bar

func (*ProgressManager) Finish

func (pm *ProgressManager) Finish(id string) error

Finish marks a progress bar as complete

func (*ProgressManager) Increment

func (pm *ProgressManager) Increment(id string) error

Increment increments progress by 1

func (*ProgressManager) Update

func (pm *ProgressManager) Update(id string, current int64) error

Update updates progress for a specific bar

type ProgressOptions

type ProgressOptions struct {
	ShowETA      bool
	ShowRate     bool
	ShowBytes    bool
	Width        int
	RefreshRate  time.Duration
	SpinnerStyle []string
}

ProgressOptions configures progress display

func DefaultProgressOptions

func DefaultProgressOptions() ProgressOptions

DefaultProgressOptions returns default progress options

type ProgressReporter

type ProgressReporter interface {
	SetTotal(total int64)
	SetCurrent(current int64)
	Increment()
	SetStatus(status string)
	SetDetails(details string)
	AddSubTask(name string)
	CompleteSubTask(name string)
}

ProgressReporter provides progress reporting interface

type ProviderConfig

type ProviderConfig struct {
	Name     string                 `yaml:"name"`
	Type     string                 `yaml:"type"`
	Enabled  bool                   `yaml:"enabled"`
	APIKey   string                 `yaml:"api_key,omitempty"`
	Endpoint string                 `yaml:"endpoint,omitempty"`
	Model    string                 `yaml:"model,omitempty"`
	Settings map[string]interface{} `yaml:"settings,omitempty"`
}

ProviderConfig represents LLM provider configuration

type QuickSetup

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

QuickSetup provides a streamlined setup for common scenarios

func NewQuickSetup

func NewQuickSetup(wizard *ConfigWizard) *QuickSetup

NewQuickSetup creates a quick setup helper

func (*QuickSetup) Run

func (qs *QuickSetup) Run() error

Run executes quick setup

type RecentFindingsWidget

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

RecentFindingsWidget displays recent vulnerability findings

func NewRecentFindingsWidget

func NewRecentFindingsWidget(style *DashboardStyle) *RecentFindingsWidget

func (*RecentFindingsWidget) GetTitle

func (w *RecentFindingsWidget) GetTitle() string

func (*RecentFindingsWidget) Render

func (w *RecentFindingsWidget) Render(width, height int) string

func (*RecentFindingsWidget) Update

func (w *RecentFindingsWidget) Update(data interface{})

type Recommendation

type Recommendation struct {
	Title    string
	Category string
	Priority string
	Effort   string
}

type RedactionConfig

type RedactionConfig struct {
	Enabled        bool
	RedactPII      bool
	RedactSecrets  bool
	RedactURLs     bool
	CustomPatterns []string
}

type RiskItem

type RiskItem struct {
	Title       string
	Category    string
	Severity    string
	Impact      string
	Likelihood  string
	Description string
}

type Row

type Row struct {
	Widgets []Widget
	Heights []int
}

Row represents a row of widgets

type Runner

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

Runner provides an interactive CLI runner with progress tracking

func NewRunner

func NewRunner(terminal *Terminal, options RunnerOptions) *Runner

NewRunner creates a new interactive runner

func (*Runner) AddTask

func (r *Runner) AddTask(task RunnerTask)

AddTask adds a task to the runner

func (*Runner) Run

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

Run executes all tasks with progress tracking

type RunnerOptions

type RunnerOptions struct {
	ShowProgress    bool
	ConcurrentTasks int
	RetryAttempts   int
	RetryDelay      time.Duration
	ContinueOnError bool
	ShowTaskDetails bool
	SummaryReport   bool
}

RunnerOptions configures the runner

func DefaultRunnerOptions

func DefaultRunnerOptions() RunnerOptions

DefaultRunnerOptions returns default runner options

type RunnerTask

type RunnerTask struct {
	ID          string
	Name        string
	Description string
	Execute     func(ctx context.Context, progress ProgressReporter) error
	Retryable   bool
	Required    bool
}

RunnerTask represents a task to be executed

type SampleReportData

type SampleReportData struct {
	ID                 string
	Timestamp          string
	TotalTests         int
	VulnerabilityCount int
	RiskScore          float64
	ComplianceStatus   string
}

type ScanData

type ScanData struct {
	ID          string
	Status      string
	Progress    int
	StartTime   time.Time
	TestsTotal  int
	TestsPassed int
	TestsFailed int
	Findings    []Finding
}

type ScanOverviewWidget

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

ScanOverviewWidget shows high-level scan status

func NewScanOverviewWidget

func NewScanOverviewWidget(style *DashboardStyle) *ScanOverviewWidget

func (*ScanOverviewWidget) GetTitle

func (w *ScanOverviewWidget) GetTitle() string

func (*ScanOverviewWidget) Render

func (w *ScanOverviewWidget) Render(width, height int) string

func (*ScanOverviewWidget) Update

func (w *ScanOverviewWidget) Update(data interface{})

type ScanResults

type ScanResults struct {
	ID                 string
	Duration           string
	TotalTests         int
	VulnerabilityCount int
	RiskScore          float64
	ComplianceStatus   string
	Vulnerabilities    []VulnerabilitySummary
	TopRisks           []RiskItem
	ComplianceResults  []ComplianceResult
	Recommendations    []Recommendation
}

ScanResults represents completed scan results

type ScanSummary

type ScanSummary struct {
	TotalTests int
	Passed     int
	Failed     int
	Critical   int
	High       int
	Medium     int
	Low        int
	Duration   time.Duration
}

ScanSummary represents scan results summary

type SecurityConfig

type SecurityConfig struct {
	APIKeyStorage  string   `yaml:"api_key_storage"`
	EncryptKeys    bool     `yaml:"encrypt_keys"`
	TLSVerify      bool     `yaml:"tls_verify"`
	AllowedDomains []string `yaml:"allowed_domains,omitempty"`
	ProxyURL       string   `yaml:"proxy_url,omitempty"`
}

SecurityConfig represents security settings

type Spinner

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

Spinner provides animated spinner for indeterminate progress

func NewSpinner

func NewSpinner(style []string) *Spinner

NewSpinner creates a new spinner

func (*Spinner) Next

func (s *Spinner) Next() string

Next returns the next frame

func (*Spinner) Reset

func (s *Spinner) Reset()

Reset resets the spinner

type StyledOutput

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

StyledOutput provides styled terminal output

func NewStyledOutput

func NewStyledOutput(writer io.Writer, colorEnabled bool, width int) *StyledOutput

NewStyledOutput creates a new styled output handler

func (*StyledOutput) Alert

func (so *StyledOutput) Alert(alertType, title, message string)

Alert prints an alert box

func (*StyledOutput) Banner

func (so *StyledOutput) Banner(text string)

Banner prints a large banner

func (*StyledOutput) CodeBlock

func (so *StyledOutput) CodeBlock(code string, indent string)

CodeBlock prints a formatted code block

func (*StyledOutput) ComparisonTable

func (so *StyledOutput) ComparisonTable(title string, headers []string, rows [][]string)

ComparisonTable prints a comparison table

func (*StyledOutput) KeyValue

func (so *StyledOutput) KeyValue(key string, value interface{})

KeyValue prints a key-value pair

func (*StyledOutput) KeyValueList

func (so *StyledOutput) KeyValueList(pairs map[string]interface{})

KeyValueList prints a list of key-value pairs

func (*StyledOutput) Quote

func (so *StyledOutput) Quote(text string, author string)

Quote prints a formatted quote

func (*StyledOutput) ScanSummary

func (so *StyledOutput) ScanSummary(summary ScanSummary)

ScanSummary prints a scan summary

func (*StyledOutput) Section

func (so *StyledOutput) Section(title string)

Section prints a section header

func (*StyledOutput) SetASCIIMode

func (so *StyledOutput) SetASCIIMode()

SetASCIIMode enables ASCII-only mode

func (*StyledOutput) SetColorScheme

func (so *StyledOutput) SetColorScheme(scheme *ColorScheme)

SetColorScheme sets the color scheme

func (*StyledOutput) StatusLine

func (so *StyledOutput) StatusLine(status, message string, args ...interface{})

StatusLine prints a status line with icon

func (*StyledOutput) TemplateInfo

func (so *StyledOutput) TemplateInfo(template TemplateInfo)

TemplateInfo prints template information

func (*StyledOutput) Tree

func (so *StyledOutput) Tree(root TreeNode, indent string)

Tree prints a tree structure

func (*StyledOutput) VulnerabilityFinding

func (so *StyledOutput) VulnerabilityFinding(finding VulnerabilityFinding)

VulnerabilityFinding prints a formatted vulnerability finding

type SubTask

type SubTask struct {
	Name     string
	Status   TaskStatus
	Progress float64
}

SubTask represents a sub-task

type Suggestion

type Suggestion struct {
	Command     string
	Description string
	Confidence  float64
	Reason      string
}

Suggestion represents a command suggestion

type SuggestionEngine

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

SuggestionEngine provides intelligent command suggestions

func NewSuggestionEngine

func NewSuggestionEngine() SuggestionEngine

NewSuggestionEngine creates a new suggestion engine

func (SuggestionEngine) GetSuggestions

func (se SuggestionEngine) GetSuggestions(command, input string) []string

GetSuggestions returns suggestions based on context

type SystemStatus

type SystemStatus struct {
	APIStatus      string
	DatabaseStatus string
	QueueStatus    string
	LastCheck      time.Time
}

type Task

type Task struct {
	ID        string
	Name      string
	Status    TaskStatus
	Progress  float64
	StartTime time.Time
	EndTime   *time.Time
	Details   string
	SubTasks  []*SubTask
	Error     error
}

Task represents a tracked task

type TaskResult

type TaskResult struct {
	TaskIndex int
	Success   bool
	Error     error
	Duration  time.Duration
	Retries   int
}

TaskResult represents the result of a task execution

type TaskStatus

type TaskStatus int

TaskStatus represents task status

const (
	TaskPending TaskStatus = iota
	TaskRunning
	TaskCompleted
	TaskFailed
	TaskSkipped
)

func (TaskStatus) String

func (ts TaskStatus) String() string

String returns string representation of task status

func (TaskStatus) Symbol

func (ts TaskStatus) Symbol() string

Symbol returns symbol for task status

type Template

type Template struct {
	ID          string
	Name        string
	Description string
	Category    string
	Severity    string
	Author      string
	Tags        []string
	Path        string
}

Template represents a test template

type TemplateBrowser

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

TemplateBrowser provides advanced template browsing

func NewTemplateBrowser

func NewTemplateBrowser(selector *TemplateSelector) *TemplateBrowser

NewTemplateBrowser creates a new template browser

func (*TemplateBrowser) Browse

func (tb *TemplateBrowser) Browse() error

Browse starts the browsing interface

type TemplateFilters

type TemplateFilters struct {
	Categories []string
	Severities []string
	Tags       []string
	Author     string
	Search     string
}

TemplateFilters for filtering templates

type TemplateInfo

type TemplateInfo struct {
	ID          string
	Name        string
	Description string
	Category    string
	Severity    string
	Author      string
	Tags        []string
}

TemplateInfo represents template information

type TemplateSelector

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

TemplateSelector provides interactive template selection

func NewTemplateSelector

func NewTemplateSelector(terminal *Terminal) *TemplateSelector

NewTemplateSelector creates a new template selector

func (*TemplateSelector) LoadTemplates

func (ts *TemplateSelector) LoadTemplates(templates []Template)

LoadTemplates loads available templates

func (*TemplateSelector) SelectTemplates

func (ts *TemplateSelector) SelectTemplates() ([]Template, error)

SelectTemplates runs interactive template selection

type Terminal

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

Terminal provides terminal UI functionality

func NewTerminal

func NewTerminal(opts TerminalOptions) *Terminal

NewTerminal creates a new terminal UI

func (*Terminal) Bold

func (t *Terminal) Bold(format string, args ...interface{})

Bold prints text in bold

func (*Terminal) Box

func (t *Terminal) Box(title, content string)

Box prints content in a bordered box

func (*Terminal) Clear

func (t *Terminal) Clear()

Clear clears the terminal screen

func (*Terminal) ClearLine

func (t *Terminal) ClearLine()

ClearLine clears the current line

func (*Terminal) ClearPreviousLines

func (t *Terminal) ClearPreviousLines(n int)

ClearPreviousLines clears n previous lines

func (*Terminal) Code

func (t *Terminal) Code(code string)

Code prints formatted code with syntax highlighting

func (*Terminal) Confirm

func (t *Terminal) Confirm(prompt string, defaultYes bool) (bool, error)

Confirm prompts for yes/no confirmation

func (*Terminal) Debug

func (t *Terminal) Debug(format string, args ...interface{})

Debug prints debug message

func (*Terminal) Dimensions

func (t *Terminal) Dimensions() (width, height int)

Dimensions returns terminal dimensions

func (*Terminal) Error

func (t *Terminal) Error(format string, args ...interface{})

Error prints error message

func (*Terminal) FinishProgress

func (t *Terminal) FinishProgress(id string)

FinishProgress finishes a progress bar

func (*Terminal) HasInput

func (t *Terminal) HasInput() bool

HasInput checks if there is input available

func (*Terminal) Header

func (t *Terminal) Header(title string)

Header prints a section header

func (*Terminal) HeaderBox

func (t *Terminal) HeaderBox(title string)

HeaderBox prints a header in a box format

func (*Terminal) Info

func (t *Terminal) Info(format string, args ...interface{})

Info prints info message

func (*Terminal) Input

func (t *Terminal) Input(prompt string, defaultValue string) (string, error)

Input prompts for user input with an optional default value

func (*Terminal) IsTerminal

func (t *Terminal) IsTerminal() bool

IsTerminal returns true if output is a terminal

func (*Terminal) KeyValue

func (t *Terminal) KeyValue(key string, value interface{})

KeyValue prints a key-value pair

func (*Terminal) List

func (t *Terminal) List(items []string, numbered bool)

List prints a formatted list

func (*Terminal) MoveCursorUp

func (t *Terminal) MoveCursorUp(n int)

MoveCursorUp moves cursor up n lines

func (*Terminal) MultiSelect

func (t *Terminal) MultiSelect(prompt string, options []string) ([]int, error)

MultiSelect prompts user to select multiple options

func (*Terminal) Muted

func (t *Terminal) Muted(format string, args ...interface{})

Muted prints text in a muted/gray color

func (*Terminal) Print

func (t *Terminal) Print(format string, args ...interface{})

Print prints plain message

func (*Terminal) Printf

func (t *Terminal) Printf(format string, args ...interface{})

Printf prints formatted text

func (*Terminal) ProgressDemo

func (t *Terminal) ProgressDemo()

ProgressDemo demonstrates progress indicators

func (*Terminal) Prompt

func (t *Terminal) Prompt(prompt string) (string, error)

Prompt prompts for user input

func (*Terminal) ReadKey

func (t *Terminal) ReadKey() string

ReadKey reads a single key from input

func (*Terminal) Section

func (t *Terminal) Section(title string)

Section prints a section header

func (*Terminal) Select

func (t *Terminal) Select(prompt string, options []string) (int, error)

Select prompts user to select from options

func (*Terminal) StartProgress

func (t *Terminal) StartProgress(id, description string, total int64)

StartProgress starts a progress bar

func (*Terminal) StartSpinner

func (t *Terminal) StartSpinner(message string) func()

StartSpinner starts an indeterminate spinner

func (*Terminal) Subheader

func (t *Terminal) Subheader(text string)

Subheader prints a subheader

func (*Terminal) Subsection

func (t *Terminal) Subsection(title string)

Subsection prints a subsection header (smaller than Section)

func (*Terminal) Success

func (t *Terminal) Success(format string, args ...interface{})

Success prints success message

func (*Terminal) Table

func (t *Terminal) Table(args ...interface{})

Table prints a formatted table with variadic arguments Can be called as: - Table(headers, rows) - separate headers and rows - Table(table) - table where first row contains headers

func (*Terminal) UpdateProgress

func (t *Terminal) UpdateProgress(id string, current int64)

UpdateProgress updates a progress bar

func (*Terminal) Warning

func (t *Terminal) Warning(format string, args ...interface{})

Warning prints warning message

type TerminalOptions

type TerminalOptions struct {
	Output       io.Writer
	Input        io.Reader
	ColorOutput  bool
	ClearScreen  bool
	ShowProgress bool
}

TerminalOptions configures terminal behavior

type TestCategory

type TestCategory struct {
	Name  string
	Tests int
}

type TestConfig

type TestConfig struct {
	ConcurrentTests int      `yaml:"concurrent_tests"`
	Timeout         int      `yaml:"timeout"`
	MaxRetries      int      `yaml:"max_retries"`
	RetryDelay      int      `yaml:"retry_delay"`
	RateLimit       int      `yaml:"rate_limit"`
	Categories      []string `yaml:"default_categories,omitempty"`
	SkipCategories  []string `yaml:"skip_categories,omitempty"`
}

TestConfig represents test execution configuration

type TestMatrix

type TestMatrix struct {
	Categories []TestCategory
	Targets    []string
	Coverage   map[string]map[string]float64
}

func (*TestMatrix) GetCoverage

func (tm *TestMatrix) GetCoverage(category, target string) float64

type TestProgressWidget

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

TestProgressWidget shows test execution progress

func NewTestProgressWidget

func NewTestProgressWidget(style *DashboardStyle) *TestProgressWidget

func (*TestProgressWidget) GetTitle

func (w *TestProgressWidget) GetTitle() string

func (*TestProgressWidget) Render

func (w *TestProgressWidget) Render(width, height int) string

func (*TestProgressWidget) Update

func (w *TestProgressWidget) Update(data interface{})

type TreeNode

type TreeNode struct {
	Name     string
	Type     string
	Children []TreeNode
}

TreeNode represents a node in a tree structure

type VulnerabilityChartWidget

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

VulnerabilityChartWidget displays vulnerability distribution

func NewVulnerabilityChartWidget

func NewVulnerabilityChartWidget(style *DashboardStyle) *VulnerabilityChartWidget

func (*VulnerabilityChartWidget) GetTitle

func (w *VulnerabilityChartWidget) GetTitle() string

func (*VulnerabilityChartWidget) Render

func (w *VulnerabilityChartWidget) Render(width, height int) string

func (*VulnerabilityChartWidget) Update

func (w *VulnerabilityChartWidget) Update(data interface{})

type VulnerabilityFinding

type VulnerabilityFinding struct {
	Severity    string
	Title       string
	Description string
	TemplateID  string
	Evidence    string
	Remediation string
}

VulnerabilityFinding represents a security finding

type VulnerabilitySummary

type VulnerabilitySummary struct {
	Severity string
	Count    int
}

type Widget

type Widget interface {
	Render(width, height int) string
	Update(data interface{})
	GetTitle() string
}

Widget represents a dashboard component

type WizardStep

type WizardStep struct {
	Name        string
	Description string
	Configure   func() error
	Skip        func() bool
}

WizardStep represents a configuration step

Jump to

Keyboard shortcuts

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