【feat】获取规则实体指定节点

Signed-off-by: PandaX <18610165312@163.com>
This commit is contained in:
PandaX
2025-03-11 02:17:48 +00:00
committed by Gitee
parent 41557d8244
commit a6b8eb1c9d

View File

@@ -38,3 +38,11 @@ func newInstanceWithManifest(m *manifest.Manifest) (*RuleChainInstance, error) {
}
return r, nil
}
// 获取规则实体指定节点
func (rule *RuleChainInstance) GetNode(nodeId string) (nodes.Node, error) {
if node,ok := rule.nodes[nodeId];ok {
return node,nil
}else {
return nil,fmt.Errorf("节点不存在")
}
}