Package: rule
A composable business rules engine added in Blueprint v0.30. Rules are named, individually testable units of business logic evaluated against a context — they keep authorization and policy decisions out of controllers.
Repository: https://github.com/dracory/rule
Installation
go get github.com/dracory/rule
Features
- Rules implement a simple
Evaluate(context)contract returning allow/deny results. - Composable — combine rules for complex policies.
- Named rules are easy to unit test in isolation.
Where It Is Used
Business rules live under internal/rules (e.g. internal/rules/auth
for login/registration policy such as the email allowlist). Controllers evaluate them
instead of inlining policy checks.