advanced

command
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 2 Imported by: 0

README

🌟 Advanced Example

This example demonstrates the advanced customization capabilities of the engine:

  • Inline Actions: Definition of Go functions executed directly upon rule success.
  • Global Handler: Capture of all engine events via a single interface.
  • Dynamic Facts: On-the-fly value calculation (e.g., dynamic discount calculation).
  • Priorities: Management of rule execution order.

Key Points Illustrated

  1. engine.RegisterEvents: Registering events with parameters and programmatic actions.
  2. engine.SetEventHandler: Setting up a centralized listener for logging or auditing.
  3. almanac.AddFact with a function: Creating a fact that is recalculated only when necessary.

Execution

go run main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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