engine

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 9 Imported by: 0

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