Skip to content

Releases: aleybovich/yabre

Enhanced WithGoFunction with support of any function signature

07 Oct 17:48
Compare
Choose a tag to compare

What's New

  • Improved Function Integration: WithGoFunction now supports any function signature, allowing for seamless integration of custom Go functions without the need for wrappers or specific types.

Breaking Changes

  • Removed GoFuncWrapper: This utility is no longer necessary due to the enhanced flexibility of WithGoFunction.

Improvements

  • Simplified API: Users can now directly pass their custom functions to WithGoFunction without modification.
  • Increased Flexibility: The engine now accommodates a wider range of function signatures, making it easier to extend functionality.

Upgrading

To upgrade, simply update your import to the latest version. If you were using GoFuncWrapper, you can now remove it and pass your functions directly to WithGoFunction.

Example:

// Old way
WithGoFunction("myFunc", GoFuncWrapper(myFunc))

// New way
WithGoFunction("myFunc", myFunc)

0.6.0 released

21 Sep 18:04
Compare
Choose a tag to compare

Release Notes: GoFuncWrapper for Business Rules Engine

New Feature: GoFuncWrapper Utility

We've introduced a new GoFuncWrapper utility to enhance the flexibility and ease of use of our Business Rules Engine (BRE).

Key Features:

  1. Allows integration of strongly-typed Go functions into the BRE
  2. Automatically adapts functions to the required func(...interface{}) (interface{}, error) signature
  3. Supports functions with various argument types and return values

Benefits:

  • Improved type safety in custom Go functions
  • Cleaner, more maintainable code
  • Better IDE support with full autocompletion and type inference
  • Easier unit testing of functions outside the BRE context
  • Seamless integration of existing functions or libraries

Usage Example:

func multiply(a, b float64) float64 {
    return a * b
}

runner, err := yabre.NewRulesRunnerFromYaml("rules.yaml", &context, 
    yabre.WithGoFunction("multiply", yabre.GoFuncWrapper(multiply)))

This update significantly enhances the developer experience when extending the BRE with custom Go functions.

v0.5.0

30 May 10:17
Compare
Choose a tag to compare

Full Changelog: v0.4.0...v0.5.0

v0.4.0 updating module name

06 May 15:34
Compare
Choose a tag to compare

v0.2.0

05 May 06:46
03e41c5
Compare
Choose a tag to compare

What's Changed

  • Added mermaid converter
  • Support for custom js fucntion names

Full Changelog: v0.1.0...v0.2.0

Basic rules engine

29 Apr 22:08
Compare
Choose a tag to compare
v0.1.0

functional rules engine v0.1