engine

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	RULES_EXEC_ERROR = "RULES_EXEC_ERROR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	sync.Mutex

	Repo     repo.RuleRepo
	Commands chan *rules.Event
	Events   chan *rules.Event
	// contains filtered or unexported fields
}

func NewRuleEngine

func NewRuleEngine(repo repo.RuleRepo, funcs rules.FuncMap, evaluator rules.Evaluator) *Engine

func (*Engine) ExecRule

func (e *Engine) ExecRule(rule *rules.Rule, event *rules.Event) *rules.EvalResult

func (*Engine) FindRules added in v0.1.6

func (e *Engine) FindRules(topic string) []*rules.Rule

func (*Engine) OnStats

func (e *Engine) OnStats(interval time.Duration, fn func(stats *EngineStats))

func (*Engine) ProcessEvents added in v0.1.4

func (e *Engine) ProcessEvents(schedulerPoolURL string) chan *rules.EvalResult

func (*Engine) SetFuncs added in v0.2.1

func (e *Engine) SetFuncs(funcs rules.FuncMap)

type EngineStats

type EngineStats struct {
	EngineEnabled     bool   `json:"engineEnabled"`
	RulesRepo         string `json:"rulesRepo"`
	ActiveRulesLoaded int    `json:"activeRulesLoaded"`
}

Jump to

Keyboard shortcuts

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