Documentation
¶
Overview ¶
Package engine orchestrates a run: it expands a Saga into scan jobs (controllers × components), executes them with bounded parallelism, and aggregates each control's results. Content-hash caching and the full describe→publish pipeline build on this.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine plans and runs scans against a registry of controllers and scanners.
func New ¶
New creates an Engine over the given registry. By default it runs up to NumCPU jobs concurrently.
func (*Engine) Plan ¶
func (e *Engine) Plan(model saga.Model) ([]PlannedJob, error)
Plan expands the model into scan jobs. Only registered controllers that are enabled (project-level for project-scoped controllers, per-component for component-scoped ones) are planned. Controllers are visited in name order for determinism.
type Option ¶
type Option func(*Engine)
Option configures an Engine.
func WithCache ¶
WithCache enables result caching: a cache hit for a job's key reuses the stored report instead of re-scanning. A nil cache disables caching (the default).
func WithConcurrency ¶
WithConcurrency sets the maximum number of scan jobs running at once. Values < 1 are ignored (the default is used).
type PlannedJob ¶
PlannedJob is a scan job tagged with the control that produced it.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds the controllers and scanners available to the engine, keyed by name.
func (*Registry) Controller ¶
func (r *Registry) Controller(name string) (plugin.Controller, bool)
Controller returns the named controller, if registered.
func (*Registry) RegisterController ¶
func (r *Registry) RegisterController(c plugin.Controller)
RegisterController adds a controller, keyed by its Info().Name.
func (*Registry) RegisterScanner ¶
RegisterScanner adds a scanner, keyed by its Info().Name.