NewEngine builds an Engine. At least one detector is expected; an Engine with no detectors always reports Degraded (fail-to-review), which is the safe posture.
(cfg EngineConfig, detectors ...Detector)
| 34 | // NewEngine builds an Engine. At least one detector is expected; an Engine with no |
| 35 | // detectors always reports Degraded (fail-to-review), which is the safe posture. |
| 36 | func NewEngine(cfg EngineConfig, detectors ...Detector) *Engine { |
| 37 | if cfg.Timeout <= 0 { |
| 38 | cfg.Timeout = defaultDetectorTimeout |
| 39 | } |
| 40 | if cfg.MinOK <= 0 { |
| 41 | cfg.MinOK = 1 |
| 42 | } |
| 43 | return &Engine{detectors: detectors, cfg: cfg} |
| 44 | } |
| 45 | |
| 46 | // Aggregate is the combined verdict plus the control signals the wiring layer needs |
| 47 | // to choose an action without knowing per-detector internals. |
no outgoing calls