Documentation
¶
Overview ¶
Package engine coordinates the scanning workflow by managing language detection, rule loading, scanner execution, and result processing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Orchestrator ¶
type Orchestrator struct {
// contains filtered or unexported fields
}
Orchestrator coordinates the entire scanning workflow. It manages language detection, rule loading, scanner execution, and result processing.
func NewOrchestrator ¶
func NewOrchestrator( langDetector language.Detector, rulesManager *rules.Manager, scannerReg *scanner.Registry, ) *Orchestrator
NewOrchestrator creates a new orchestrator with the required dependencies.
func (*Orchestrator) Scan ¶
func (o *Orchestrator) Scan(ctx context.Context, opts ScanOptions) (*entities.InterimReport, error)
Scan orchestrates the complete scanning workflow.
Workflow:
- Detect languages (or use hint if provided)
- Load rules from manager
- Get scanner from registry
- Initialize scanner
- Execute scan with loaded rule paths
- Process and enrich results
Returns the final interim report or an error if any step fails.
type Processor ¶
type Processor struct{}
Processor handles result aggregation and enrichment. For MVP, it performs basic validation and metadata enrichment.
func (*Processor) Process ¶
func (p *Processor) Process(report *entities.InterimReport, _ []string, targetDir string) (*entities.InterimReport, error)
Process enriches and validates the scan results.
Current processing:
- Validates report structure
- Ensures all required fields are present
type ScanOptions ¶
type ScanOptions struct {
// Target is the directory or file to scan
Target string
// ScannerName is the name of the scanner to use (e.g., "semgrep")
ScannerName string
// LanguageHint allows manual override of language detection (from --languages flag)
LanguageHint []string
// ScannerConfig contains scanner-specific configuration
ScannerConfig scanner.Config
}
ScanOptions contains all configuration options for a scan operation.