Extension Components Overview
RuleGo provides not only standard components, but also an extended component library rulego-components
, project address: Github (opens new window) | Gitee (opens new window).
If you need to use extended components, you need to manually import them separately. In addition, using RuleGo ecosystem or third-party provided components is also the same way to import.
# Usage
- Use the
go get
command to installrulego-components
or other third-party components:
go get github.com/rulego/rulego-components@main
- Use a blank symbol to import the corresponding component to complete the registration, for example:
import (
_ "github.com/rulego/rulego-components/external/redis"
)
2
3
- Then in the rule chain, use the component by configuring
type
andconfiguration
:
{
"id": "s5",
"type": "x/redisClient",
"name": "Save to redis",
"debugMode": true,
"configuration": {
"cmd": "SET",
"params": ["${key}", "${msg.data}"],
"poolSize": 10,
"Server": "192.168.1.1:6379"
}
}
2
3
4
5
6
7
8
9
10
11
12
# Other Extended Components
- rulego-components (opens new window)
- rulego-components-ai (opens new window)
- rulego-components-ci (opens new window)
- rulego-components-iot (opens new window)
# Contribute components
One of RuleGo's core features is componentization, where all business logic is components and can be flexibly configured and reused. RuleGo has already built-in a lot of common components. However, we know that these components are far from meeting the needs of all users, so we hope that more developers can contribute extended components to RuleGo, making RuleGo's ecosystem more rich and powerful.
- If the code for your component does not have third-party dependencies or is a general-purpose component, please submit it to the standard components components (opens new window) under the main repository.
- Common components should be submitted to the extension component repository: rulego-components (opens new window)
- CI/CD related components should be submitted to: rulego-components-ci (opens new window)
- AI-related components should be submitted to: rulego-components-ai (opens new window)
- IoT-related components should be submitted to: rulego-components-iot (opens new window)