engine

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: GPL-2.0, GPL-2.0-only Imports: 8 Imported by: 0

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

Scan orchestrates the complete scanning workflow.

Workflow:

  1. Detect languages (or use hint if provided)
  2. Load rules from manager
  3. Get scanner from registry
  4. Initialize scanner
  5. Execute scan with loaded rule paths
  6. 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 NewProcessor

func NewProcessor() *Processor

NewProcessor creates a new result processor.

func (*Processor) Process

func (p *Processor) Process(report *entities.InterimReport, _ []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.

Jump to

Keyboard shortcuts

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