RuleGo RuleGo
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • 快速入门

  • 规则链

  • 标准组件

  • 扩展组件

    • 扩展组件概述
      • 使用方法
      • 其他扩展组件
      • 贡献组件
    • 过滤器

    • 转换器

    • 外部的

    • AI

    • CI

    • IoT

  • 自定义组件

  • 组件市场

  • 可视化

  • AOP

  • 触发器

  • 高级主题

  • RuleGo-Server

  • 问题

目录

扩展组件概述

RuleGo除了提供标准组件外,还提供了丰富的扩展组件库rulego-components,项目地址:Github (opens new window) | Gitee (opens new window)。 扩展组件需要额外手动导入使用。RuleGo生态或第三方提供的组件也采用相同的导入方式。

# 使用方法

  1. 使用go get命令安装所需的扩展组件:
  2. 注册组件:
//如果组件在init有注册逻辑,则只需引入该组件,触发其init函数即可
   import (
   // 注册扩展组件库
   // 使用`go build -tags with_extend .`把扩展组件编译到运行文件
   _ "github.com/rulego/rulego-components/endpoint/beanstalkd"
   _ "github.com/rulego/rulego-components/endpoint/grpc_stream"
   _ "github.com/rulego/rulego-components/endpoint/kafka"
  _ "github.com/rulego/rulego-components/external/mongodb"
  _ "github.com/rulego/rulego-components/external/nats"
 )
//否则手动注册
  rulego.Registry.Register(&xx{})
1
2
3
4
5
6
7
8
9
10
11
12
  1. 然后在规则链,通过配置type和configuration使用组件:
{
  "id": "s5",
  "type": "x/redisClient",
  "name": "保存到redis",
  "debugMode": true,
  "configuration": {
    "cmd": "SET",
    "params": ["${key}", "${msg.data}"],
    "poolSize": 10,
    "Server": "192.168.1.1:6379"
  }
}
1
2
3
4
5
6
7
8
9
10
11
12

# 其他扩展组件

  • rulego-components (opens new window)
  • rulego-components-ai (opens new window)
  • rulego-components-ci (opens new window)
  • rulego-components-iot (opens new window)
  • rulego-components-etl (opens new window)

# 贡献组件

RuleGo采用组件化架构设计,所有业务逻辑都以组件形式实现,并支持灵活配置和重用。虽然RuleGo已内置了大量常用组件,但为了满足更多样化的业务需求,我们欢迎开发者为RuleGo贡献更多扩展组件,共同打造丰富和强大的RuleGo生态。

贡献组件时请遵循以下原则:

  • 如果组件代码没有第三方依赖或属于通用性组件,请提交到主库的标准组件目录:components (opens new window)
  • 如果组件依赖第三方库或为特定场景定制,请提交到扩展组件仓库:rulego-components (opens new window)
  • 如果组件为物联网场景定制,请提交到扩展组件仓库:rulego-components-iot (opens new window)
  • 如果组件为ETL场景定制,请提交到扩展组件仓库:rulego-components-etl (opens new window)
  • 如果组件为CI/CD场景定制,请提交到扩展组件仓库:rulego-components-ci (opens new window)
  • 如果组件为AI场景定制,请提交到扩展组件仓库:rulego-components-ai (opens new window)
在 GitHub 上编辑此页 (opens new window)
上次更新: 2025/03/31, 01:52:11
节点引用
lua脚本过滤器

← 节点引用 lua脚本过滤器→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式