engine

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRuleEngineFactory

func RegisterRuleEngineFactory(factory RuleEngineFactory)

RegisterRuleEngineFactory makes a rule engine available for automatic discovery by the incident engine.

Types

type IncidentEngine

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

IncidentEngine is the runtime bridge from collected signals to durable incident state.

func NewIncidentEngine

func NewIncidentEngine(
	c client.Client,
	signals <-chan collectors.Signal,
	logger logr.Logger,
	opts ...Option,
) (*IncidentEngine, error)

NewIncidentEngine resolves a rule engine automatically and wires it into the incident processing runtime.

func (*IncidentEngine) NeedLeaderElection added in v0.0.12

func (e *IncidentEngine) NeedLeaderElection() bool

NeedLeaderElection ensures only the active leader runs the incident engine.

func (*IncidentEngine) RuleEngineName

func (e *IncidentEngine) RuleEngineName() string

func (*IncidentEngine) Run

func (e *IncidentEngine) Run(ctx context.Context)

func (*IncidentEngine) Start added in v0.0.12

func (e *IncidentEngine) Start(ctx context.Context) error

Start implements manager.Runnable and runs the incident engine loop.

type Option

type Option func(*incidentEngineOptions)

func WithConsumerOption

func WithConsumerOption(opt correlator.Option) Option

WithConsumerOption appends a low-level consumer option for compatibility while the incident engine surface is being normalized.

func WithContext added in v0.0.6

func WithContext(ctx context.Context) Option

WithContext sets the context used for rule engine initialization (e.g. loading CRD rules at startup).

func WithCorrelationWindow

func WithCorrelationWindow(window time.Duration) Option

WithCorrelationWindow overrides the temporary correlation window used by the currently resolved rule engine.

func WithEventRecorder

func WithEventRecorder(recorder events.EventRecorder) Option

WithEventRecorder forwards lifecycle events through the incident engine's consumer compatibility layer.

func WithRuleEngine

func WithRuleEngine(ruleEngine RuleEngine) Option

WithRuleEngine allows explicit injection of a rule engine implementation.

func WithRuleEngineName

func WithRuleEngineName(name string) Option

WithRuleEngineName asks the incident engine to resolve a specific registered rule engine. When unset, the incident engine auto-selects the highest-priority compatible engine.

type RuleEngine

type RuleEngine interface {
	correlator.RuleEngine
	Name() string
}

RuleEngine is the engine-owned contract for correlated incident evaluation.

type RuleEngineConfig

type RuleEngineConfig struct {
	CorrelationWindow time.Duration
	Context           context.Context
}

RuleEngineConfig carries runtime settings into a resolved rule engine.

type RuleEngineDiscovery

type RuleEngineDiscovery struct {
	PreferredName string
}

type RuleEngineFactory

type RuleEngineFactory interface {
	Name() string
	Priority() int
	Supports(RuleEngineDiscovery) bool
	Build(RuleEngineConfig) (RuleEngine, error)
}

RuleEngineFactory builds a rule engine implementation that the incident engine can discover at runtime.

Jump to

Keyboard shortcuts

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