MCPcopy Index your code
hub / github.com/bilibili/gengine

github.com/bilibili/gengine @v1.5.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.7 ↗ · + Follow
1,703 symbols 3,731 edges 142 files 495 documented · 29%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

license Documentation

Gengine

  • English document
  • 或者加入QQ交流群1132683357(内有官方微信交流群二维码)

基于golang的规则引擎

  • Gengine是一款基于AST(Abstract Syntax Tree)和golang语言实现的规则引擎(动态化加载框架)。能够让你在golang这种静态语言上,在不停服务的情况下实现动态加载与配置规则。
  • 代码结构松散,逻辑极其简单,但经过了必要且详尽的测试
  • Gengine所支持的规则,就是一门DSL(领域专用语言)
  • Gengine是一款高性能框架动态加载,与golang无缝对接,支持多种执行模式、支持规则池等满足各种业务场景需求

设计思想

  • 可以看这篇文章: https://xie.infoq.cn/article/40bfff1fbca1867991a1453ac

官方文档

  • 中文文档 https://github.com/bilibili/gengine/wiki
  • English doc: https://rencalo770.github.io/gengine_en/#/introduce

支持的执行模式

avatar

使用

  • 建议使用最新版本
  • go mod 或者 go vendor, go mod 引入:
require github.com/bilibili/gengine v1.5.6

问题联系

  • 提issue

Extension points exported contracts — how you extend this code

ExpressionHolder (Interface)
(no doc) [7 implementers]
internal/base/expression_holder.go
Iteration (Interface)
Iteration 迭代器 [3 implementers]
internal/iter/iter.go
IPrimaryContext (Interface)
IPrimaryContext is an interface to support dynamic dispatch. [1 implementers]
internal/iantlr/alr/gengine_parser.go
Man (Interface)
(no doc) [1 implementers]
test/plugin/plugin_superman.go
StatementsHolder (Interface)
(no doc) [6 implementers]
internal/base/statements_holder.go
IRuleEntityContext (Interface)
IRuleEntityContext is an interface to support dynamic dispatch. [1 implementers]
internal/iantlr/alr/gengine_parser.go
VariableHolder (Interface)
(no doc) [5 implementers]
internal/base/variable_holder.go
IRuleNameContext (Interface)
IRuleNameContext is an interface to support dynamic dispatch. [1 implementers]
internal/iantlr/alr/gengine_parser.go

Core symbols most depended-on inside this repo

Add
called by 201
context/data_context.go
Execute
called by 93
engine/gengine.go
NewDataContext
called by 71
context/data_context.go
NewRuleBuilder
called by 69
builder/rule_builder.go
BuildRuleFromString
called by 69
builder/rule_builder.go
NewGengine
called by 67
engine/gengine.go
EnterRule
called by 41
internal/iantlr/alr/gengine_parser.go
ExitRule
called by 41
internal/iantlr/alr/gengine_parser.go

Shape

Method 1,173
Function 311
Struct 153
Interface 65
TypeAlias 1

Languages

Go100%

Modules by API surface

internal/iantlr/alr/gengine_parser.go739 symbols
internal/iparser/gengine_parser_listener.go91 symbols
internal/iantlr/alr/gengine_base_listener.go91 symbols
internal/iantlr/alr/gengine_listener.go87 symbols
engine/gengine_pool.go47 symbols
internal/iantlr/alr/gengine_visitor.go39 symbols
internal/iantlr/alr/gengine_base_visitor.go39 symbols
test/return_nil_test.go33 symbols
engine/gengine.go26 symbols
test/server_pool_update_test.go14 symbols
context/data_context.go14 symbols
test/return_statement_test.go13 symbols

For agents

$ claude mcp add gengine \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact