json

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: 3 Imported by: 0

README

📄 JSON Example

This example shows how to deserialize rules and facts directly from JSON format. This is the recommended usage if you want to store your rules in a database or configuration files without recompiling your code.

Features Illustrated

  • json.Unmarshal for Rule structures.
  • Data Nesting: Access to nested facts (e.g., customer.type) thanks to the engine's built-in support.
  • Data/Logic Separation: Rules can be loaded separately from the execution context (Almanac).
  • Formatted API Response: Using GenerateResponse() to obtain a clean, JSON-serializable consolidated result.

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