Releases: aleybovich/yabre
Releases · aleybovich/yabre
Enhanced WithGoFunction with support of any function signature
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 ofWithGoFunction
.
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
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:
- Allows integration of strongly-typed Go functions into the BRE
- Automatically adapts functions to the required
func(...interface{}) (interface{}, error)
signature - 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
Full Changelog: v0.4.0...v0.5.0
v0.4.0 updating module name
Full Changelog: v0.3.0...v0.4.0
v0.2.0
What's Changed
- Added mermaid converter
- Support for custom js fucntion names
Full Changelog: v0.1.0...v0.2.0
Basic rules engine
v0.1.0 functional rules engine v0.1