Browse Source

doc(*): modify chn directory.json and move chn docs for translation

Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Jiyong Huang 3 years ago
parent
commit
38c2f44266
46 changed files with 1063 additions and 318 deletions
  1. 364 213
      docs/directory.json
  2. 184 0
      docs/zh_CN/CONTRIBUTING.md
  3. 59 0
      docs/zh_CN/concepts/ekuiper.md
  4. 23 0
      docs/zh_CN/concepts/extensions.md
  5. 19 0
      docs/zh_CN/concepts/rules.md
  6. 13 0
      docs/zh_CN/concepts/sinks.md
  7. 30 0
      docs/zh_CN/concepts/sources/overview.md
  8. 10 0
      docs/zh_CN/concepts/sources/stream.md
  9. 17 0
      docs/zh_CN/concepts/sources/table.md
  10. 11 0
      docs/zh_CN/concepts/sql.md
  11. 10 0
      docs/zh_CN/concepts/streaming/join.md
  12. 31 0
      docs/zh_CN/concepts/streaming/overview.md
  13. 18 0
      docs/zh_CN/concepts/streaming/time.md
  14. 12 0
      docs/zh_CN/concepts/streaming/windowing.md
  15. 35 3
      docs/zh_CN/extension/native/overview.md
  16. 0 58
      docs/zh_CN/extension/native/sinks/redis.md
  17. 2 2
      docs/zh_CN/operation/restapi/plugins.md
  18. 78 7
      docs/zh_CN/reference.md
  19. 16 16
      docs/zh_CN/rules/sinks/edgex.md
  20. 0 0
      docs/zh_CN/rules/sinks/builtin/log.md
  21. 1 1
      docs/zh_CN/rules/sinks/memory.md
  22. 1 1
      docs/zh_CN/rules/sinks/mqtt.md
  23. 0 0
      docs/zh_CN/rules/sinks/builtin/nop.md
  24. 1 1
      docs/zh_CN/rules/sinks/rest.md
  25. 29 0
      docs/zh_CN/rules/sinks/overview.md
  26. 0 0
      docs/zh_CN/rules/sinks/plugin/file.md
  27. 0 0
      docs/zh_CN/rules/sinks/plugin/image.md
  28. 0 0
      docs/zh_CN/rules/sinks/plugin/influx.md
  29. 59 0
      docs/zh_CN/rules/sinks/plugin/redis.md
  30. 0 0
      docs/zh_CN/rules/sinks/plugin/tdengine.md
  31. 0 0
      docs/zh_CN/rules/sinks/plugin/zmq.md
  32. 2 2
      docs/zh_CN/rules/sources/edgex.md
  33. 2 2
      docs/zh_CN/rules/sources/file.md
  34. 1 1
      docs/zh_CN/rules/sources/http_pull.md
  35. 1 1
      docs/zh_CN/rules/sources/memory.md
  36. 1 1
      docs/zh_CN/rules/sources/mqtt.md
  37. 24 0
      docs/zh_CN/rules/sources/overview.md
  38. 0 0
      docs/zh_CN/rules/sources/plugin/random.md
  39. 0 0
      docs/zh_CN/rules/sources/plugin/zmq.md
  40. 3 3
      docs/zh_CN/extension/native/functions/functions.md
  41. 3 3
      docs/zh_CN/extension/native/functions/tensorflow_lite_tutorial.md
  42. 0 0
      docs/zh_CN/tutorials/deploy/add_service.png
  43. 0 0
      docs/zh_CN/tutorials/deploy/ekuiper_openyurt.png
  44. 0 0
      docs/zh_CN/tutorials/deploy/kmanager.yaml
  45. 3 3
      docs/zh_CN/deploy/openyurt_tutorial.md
  46. 0 0
      docs/zh_CN/tutorials/deploy/ping.png

+ 364 - 213
docs/directory.json

@@ -2,234 +2,358 @@
 	"cn": [
 		{
 			"title": "概要",
-			"path": "./"
+			"path": "reference"
 		},
 		{
-			"title": "安装试用",
-			"children": [{
-					"title": "下载安装快速入门",
+			"title": "快速开始",
+			"children": [
+				{
+					"title": "本地运行",
 					"path": "getting_started"
 				},
 				{
-					"title": "Docker 容器安装教程",
+					"title": "Docker 容器运行",
 					"path": "quick_start_docker"
 				},
 				{
-					"title": "EdgeX Foundry 规则引擎教程",
+					"title": "作为 EdgeX Foundry 规则引擎运行",
 					"path": "edgex/edgex_rule_engine_tutorial"
-				},
-				{
-					"title": "如何使用 meta 函数抽取在 EdgeX 消息总线中发送的其它信息",
-					"path": "edgex/edgex_meta"
 				}
 			]
 		},
 		{
-			"title": "规则",
-			"children": [{
-					"title": "规则管理",
-					"path": "rules/overview"
+			"title": "概念",
+			"children": [
+				{
+					"title": "eKuiper 基本概念",
+					"path": "concepts/ekuiper"
 				},
 				{
-				"title": "规则流水线",
-				"path": "rules/rule_pipeline"
+					"title": "规则",
+					"path": "concepts/rules"
 				},
 				{
-					"title": "Sinks 动作",
-					"children": [{
-							"title": "EdgeX 消息总线目标",
-							"path": "rules/sinks/edgex"
-						},
-						{
-							"title": "MQTT 动作",
-							"path": "rules/sinks/mqtt"
-						},
-						{
-							"title": "Nop 动作",
-							"path": "rules/sinks/nop"
-						},
+					"title": "Sources 源",
+					"children": [
 						{
-							"title": "REST动作",
-							"path": "rules/sinks/rest"
+							"title": "概览",
+							"path": "concepts/sources/overview"
 						},
 						{
-							"title": "日志操作",
-							"path": "rules/sinks/log"
+							"title": "流",
+							"path": "concepts/sources/stream"
 						},
 						{
-							"title": "内存动作",
-							"path": "rules/sinks/memory"
+							"title": "表",
+							"path": "concepts/sources/table"
 						}
 					]
 				},
 				{
-					"title": "Sources 源",
-					"children": [{
-							"title": "EdgeX 源",
-							"path": "rules/sources/edgex"
-						},
+					"title": "Sinks 动作",
+					"path": "concepts/sinks"
+				},
+				{
+					"title": "SQL 查询",
+					"path": "concepts/sql"
+				},
+				{
+					"title": "流式处理",
+					"children": [
 						{
-							"title": "HTTP 提取源",
-							"path": "rules/sources/http_pull"
+							"title": "概览",
+							"path": "concepts/streaming/overview"
 						},
 						{
-							"title": "MQTT源",
-							"path": "rules/sources/mqtt"
+							"title": "时间属性",
+							"path": "concepts/streaming/time"
 						},
 						{
-							"title": "文件源",
-							"path": "rules/sources/file"
+							"title": "窗口",
+							"path": "concepts/streaming/windowing"
 						},
 						{
-							"title": "内存源",
-							"path": "rules/sources/memory"
+							"title": "连接",
+							"path": "concepts/streaming/join"
 						}
 					]
 				},
 				{
-					"title": "Golang 模版",
-					"path": "rules/data_template"
-				},
-				{
-					"title": "状态和容错",
-					"path": "rules/state_and_fault_tolerance"
+					"title": "扩展",
+					"path": "concepts/extensions"
 				}
-
 			]
 		},
-
 		{
-			"title": "eKuiper SQL 参考",
+			"title": "教程",
 			"children": [
 				{
-					"title": "eKuiper SQL 介绍",
-					"path": "sqls/overview"
-				},
-				{
-					"title": "流规格",
-					"path": "sqls/streams"
-				},
-				{
-					"title": "表规格",
-					"path": "sqls/tables"
-				},
-				{
-					"title": "查询语言元素",
-					"path": "sqls/query_language_elements"
-				},
-				{
-					"title": "窗口",
-					"path": "sqls/windows"
-				},
-				{
-					"title": "函数",
-					"path": "sqls/built-in_functions"
-				},
-				{
-					"title": "数据类型",
-					"path": "sqls/data_types"
+					"title": "AI 教程",
+					"children": [
+						{
+							"title": "Label image by tensorflow lite model with eKuiper native plugin",
+							"path": "tutorials/ai/tensorflow_lite_tutorial"
+						}
+					]
 				},
 				{
-					"title": "eKuiper 词汇元素",
-					"path": "sqls/lexical_elements"
+					"title": "EdgeX Foundry 相关教程",
+					"children": [
+						{
+							"title": "EdgeX Foundry rule engine tutorial",
+							"path": "edgex/edgex_rule_engine_tutorial"
+						},
+						{
+							"title": "Meta function for EdgeX stream",
+							"path": "edgex/edgex_meta"
+						},
+						{
+							"title": "Command device with EdgeX eKuiper rules enginem",
+							"path": "edgex/edgex_rule_engine_command"
+						},
+						{
+							"title": "EdgeX source configuration command",
+							"path": "edgex/edgex_source_tutorial"
+						}
+					]
 				},
 				{
-					"title": "JSON 表达式",
-					"path": "sqls/json_expr"
+					"title": "通过 OpenYurt 部署教程",
+					"path": "tutorials/deploy/openyurt_tutorial"
 				}
 			]
 		},
 		{
-			"title": "扩展 eKuiper",
-			"children": [{
-					"title": "扩展概要",
-					"path": "extension/overview"
-				},
+			"title": "参考",
+			"children": [
 				{
-					"title": "调用外部函数",
-					"path": "extension/external/external_func"
-
+					"title": "规则",
+					"children": [
+						{
+							"title": "概览",
+							"path": "rules/overview"
+						},
+						{
+							"title": "规则流水线",
+							"path": "rules/rule_pipeline"
+						},
+						{
+							"title": "状态和容错",
+							"path": "rules/state_and_fault_tolerance"
+						}
+					]
 				},
 				{
-					"title": "原生插件开发",
+					"title": "Sources 源",
 					"children": [
 						{
-							"title": "原生插件概要",
-							"path": "extension/native/overview"
+							"title": "概览",
+							"path": "rules/sources/overview"
 						},
 						{
-							"title": "自定义原生插件开发",
+							"title": "内置源",
 							"children": [
 								{
-									"title": "插件开发介绍",
-									"path": "extension/native/develop/overview"
+									"title": "MQTT 源",
+									"path": "rules/sources/builtin/mqtt"
 								},
 								{
-									"title": "插件开发教程",
-									"path": "extension/native/develop/plugins_tutorial"
+									"title": "EdgeX 源",
+									"path": "rules/sources/builtin/edgex"
 								},
 								{
-									"title": "函数插件开发",
-									"path": "extension/native/develop/function"
+									"title": "HTTP 拉取源",
+									"path": "rules/sources/builtin/http_pull"
 								},
 								{
-									"title": "目标插件开发",
-									"path": "extension/native/develop/sink"
+									"title": "内存源",
+									"path": "rules/sources/builtin/memory"
 								},
 								{
-									"title": "源插件开发",
-									"path": "extension/native/develop/source"
+									"title": "文件源",
+									"path": "rules/sources/builtin/file"
 								}
 							]
 						},
 						{
-							"title": "预定义的目标扩展",
+							"title": "预定义插件源",
 							"children": [
 								{
-											"title": "文件目标(Sink)",
-											"path": "extension/native/sinks/file"
-										},
+									"title": "Zero MQ 源",
+									"path": "rules/sources/plugin/zmq"
+								},
 								{
-											"title": "图像目标(Sink)",
-											"path": "extension/native/sinks/image"
-										},
+									"title": "随机源",
+									"path": "rules/sources/plugin/random"
+								}
+							]
+						}
+					]
+				},
+				{
+					"title": "Sinks 动作",
+					"children": [
+						{
+							"title": "概览",
+							"path": "rules/sinks/overview"
+						},
+						{
+							"title": "数据模板",
+							"path": "rules/data_template"
+						},
+						{
+							"title": "内置 sinks",
+							"children": [
+								{
+									"title": "MQTT 动作",
+									"path": "rules/sinks/builtin/mqtt"
+								},
 								{
-											"title": "InfluxDB 目标(Sink)",
-											"path": "extension/native/sinks/influx"
-										},
+									"title": "EdgeX 动作",
+									"path": "rules/sinks/builtin/edgex"
+								},
+								{
+									"title": "REST 动作",
+									"path": "rules/sinks/builtin/rest"
+								},
 								{
-											"title": "redis 目标(Sink)",
-											"path": "extension/native/sinks/redis"
-										},
+									"title": "内存动作",
+									"path": "rules/sinks/builtin/memory"
+								},
 								{
-											"title": "TDengine 目标(Sink)",
-											"path": "extension/native/sinks/tdengine"
-										},
+									"title": "日志动作",
+									"path": "rules/sinks/builtin/log"
+								},
 								{
-											"title": "Zmq 目标(Sink)",
-											"path": "extension/native/sinks/zmq"
-										}
+									"title": "Nop 动作",
+									"path": "rules/sinks/builtin/nop"
+								}
 							]
 						},
 						{
-									"title": "预定义的源扩展",
-									"children": [{
-										"title": "random 源(Source)",
-										"path": "extension/native/sources/random"
-									},
-										{
-											"title": "Zmq 源(Source)",
-											"path": "extension/native/sources/zmq"
-										}
-									]
+							"title": "预定义 sink 插件",
+							"children": [
+								{
+									"title": "Zero MQ 动作",
+									"path": "rules/sinks/plugin/zmq"
+								},
+								{
+									"title": "文件动作",
+									"path": "rules/sinks/plugin/file"
+								},
+								{
+									"title": "InfluxDB 动作",
+									"path": "rules/sinks/plugin/influx"
+								},
+								{
+									"title": "TDengine 动作",
+									"path": "rules/sinks/plugin/tdengine"
+								},
+								{
+									"title": "Redis 动作",
+									"path": "rules/sinks/plugin/redis"
+								},
+								{
+									"title": "图像动作",
+									"path": "rules/sinks/plugin/image"
+								}
+							]
+						}
+					]
+				},
+				{
+					"title": "SQL 参考",
+					"children": [
+						{
+							"title": "语法",
+							"children": [
+								{
+									"title": "概览",
+									"path": "sqls/overview"
+								},
+								{
+									"title": "词汇元素",
+									"path": "sqls/lexical_elements"
+								},
+								{
+									"title": "数据类型",
+									"path": "sqls/data_types"
+								},
+								{
+									"title": "JSON 表达式",
+									"path": "sqls/json_expr"
 								},
+								{
+									"title": "查询语言元素",
+									"path": "sqls/query_language_elements"
+								}
+							]
+						},
 						{
-									"title": "预定义的函数扩展",
-									"path": "extension/native/functions/functions"
+							"title": "语句",
+							"children": [
+								{
+									"title": "流语句",
+									"path": "sqls/streams"
+								},
+								{
+									"title": "表语句",
+									"path": "sqls/tables"
 								}
+							]
+						},
+						{
+							"title": "窗口",
+							"path": "sqls/windows"
+						},
+						{
+							"title": "内置函数",
+							"path": "sqls/built-in_functions"
+						},
+						{
+							"title": "预定义函数插件",
+							"path": "sqls/custom_functions"
+						}
+					]
+				}
+			]
+		},
+		{
+			"title": "扩展开发",
+			"children": [
+				{
+					"title": "概览",
+					"path": "extension/overview"
+				},
+				{
+					"title": "原生插件开发",
+					"children": [
+						{
+							"title": "总览",
+							"path": "extension/native/overview"
+						},
+						{
+							"title": "原生插件总览",
+							"path": "extension/native/develop/overview"
+						},
+						{
+							"title": "插件开发教程",
+							"path": "extension/native/develop/plugins_tutorial"
+						},
+						{
+							"title": "函数插件开发",
+							"path": "extension/native/develop/function"
+						},
+						{
+							"title": "动作插件开发",
+							"path": "extension/native/develop/sink"
+						},
+						{
+							"title": "源插件开发",
+							"path": "extension/native/develop/source"
+						}
 					]
 				},
-
 				{
 					"title": "Portable 插件开发",
 					"children": [
@@ -246,64 +370,43 @@
 							"path": "extension/portable/python_sdk"
 						}
 					]
+				},
+				{
+					"title": "外部函数",
+					"path": "extension/external/external_func"
 				}
 			]
 		},
-
 		{
 			"title": "使用指南",
 			"children": [
 				{
-					"title": "安装",
-					"path": "operation/install/overview"
-				},
-				{
-					"title": "centos 安装",
-					"path": "operation/install/cent-os"
-				},
-				{
-					"title": "配置文件",
-					"path": "operation/config/configuration_file"
-				},
-				{
-					"title": "认证配置",
-					"path": "operation/config/authentication"
+					"title": "概览",
+					"path": "operation/overview"
 				},
 				{
-					"title": "命令行工具",
+					"title": "安装",
 					"children": [
 						{
-							"title": "摘要",
-							"path": "operation/cli/overview"
-						},
-						{
-							"title": "流管理",
-							"path": "operation/cli/streams"
-						},
-						{
-							"title": "规则管理",
-							"path": "operation/cli/rules"
-						},
-						{
-							"title": "表管理",
-							"path": "operation/cli/tables"
+							"title": "安装指南",
+							"path": "operation/install/overview"
 						},
 						{
-							"title": "插件管理",
-							"path": "operation/cli/plugins"
+							"title": "centos 安装",
+							"path": "operation/install/cent-os"
 						}
 					]
 				},
 				{
-					"title": "管理控制台",
+					"title": "配置",
 					"children": [
 						{
-							"title": "控制台使用",
-							"path": "operation/manager-ui/overview"
+							"title": "配置文件",
+							"path": "operation/config/configuration_file"
 						},
 						{
-							"title": "如何将自定义的插件展示在管理控制台的安装列表",
-							"path": "operation/manager-ui/plugins_in_manager"
+							"title": "认证配置",
+							"path": "operation/config/authentication"
 						}
 					]
 				},
@@ -337,10 +440,61 @@
 					]
 				},
 				{
-					"title": "交叉编译",
-					"path": "operation/compile/cross-compile"
+					"title": "命令行工具",
+					"children": [
+						{
+							"title": "总览",
+							"path": "operation/cli/overview"
+						},
+						{
+							"title": "流管理",
+							"path": "operation/cli/streams"
+						},
+						{
+							"title": "表管理",
+							"path": "operation/cli/tables"
+						},
+						{
+							"title": "规则管理",
+							"path": "operation/cli/rules"
+						},
+						{
+							"title": "插件管理",
+							"path": "operation/cli/plugins"
+						}
+					]
+				},
+				{
+					"title": "管理控制台",
+					"children": [
+						{
+							"title": "控制台使用",
+							"path": "operation/manager-ui/overview"
+						},
+						{
+							"title": "插件管理",
+							"path": "operation/manager-ui/plugins_in_manager"
+						}
+					]
+				},
+				{
+					"title": "编译",
+					"children": [
+						{
+							"title": "编译指南",
+							"path": "operation/compile/compile"
+						},
+						{
+							"title": "交叉编译",
+							"path": "operation/compile/cross-compile"
+						}
+					]
 				}
 			]
+		},
+		{
+			"title": "贡献",
+			"path": "CONTRIBUTING"
 		}
 	],
 	"en": [
@@ -523,7 +677,7 @@
 							"title": "Predefined source plugins",
 							"children": [
 								{
-									"title": "Zmq source",
+									"title": "Zero MQ source",
 									"path": "rules/sources/plugin/zmq"
 								},
 								{
@@ -578,7 +732,7 @@
 							"title": "Predefined sink plugins",
 							"children": [
 								{
-									"title": "Zmq sink",
+									"title": "Zero MQ sink",
 									"path": "rules/sinks/plugin/zmq"
 								},
 								{
@@ -677,29 +831,24 @@
 							"path": "extension/native/overview"
 						},
 						{
-							"title": "Custom native plugin develop",
-							"children": [
-								{
-									"title": "Plugin develop introduction",
-									"path": "extension/native/develop/overview"
-								},
-								{
-									"title": "Plugin develop tutorial",
-									"path": "extension/native/develop/plugins_tutorial"
-								},
-								{
-									"title": "Function plugin",
-									"path": "extension/native/develop/function"
-								},
-								{
-									"title": "Sink plugin",
-									"path": "extension/native/develop/sink"
-								},
-								{
-									"title": "Source plugin",
-									"path": "extension/native/develop/source"
-								}
-							]
+							"title": "Native plugins overview",
+							"path": "extension/native/develop/overview"
+						},
+						{
+							"title": "Plugin develop tutorial",
+							"path": "extension/native/develop/plugins_tutorial"
+						},
+						{
+							"title": "Function plugin",
+							"path": "extension/native/develop/function"
+						},
+						{
+							"title": "Sink plugin",
+							"path": "extension/native/develop/sink"
+						},
+						{
+							"title": "Source plugin",
+							"path": "extension/native/develop/source"
 						}
 					]
 				},
@@ -761,10 +910,11 @@
 				},
 				{
 					"title": "Rest API",
-					"children": [{
-						"title": "Introduction",
-						"path": "operation/restapi/overview"
-					},
+					"children": [
+						{
+							"title": "Introduction",
+							"path": "operation/restapi/overview"
+						},
 						{
 							"title": "Streams",
 							"path": "operation/restapi/streams"
@@ -789,10 +939,11 @@
 				},
 				{
 					"title": "Command line tool",
-					"children": [{
-						"title": "Introduction",
-						"path": "operation/cli/overview"
-					},
+					"children": [
+						{
+							"title": "Introduction",
+							"path": "operation/cli/overview"
+						},
 						{
 							"title": "Streams",
 							"path": "operation/cli/streams"

+ 184 - 0
docs/zh_CN/CONTRIBUTING.md

@@ -0,0 +1,184 @@
+# How to contribute
+
+We're really glad you're reading this, because we need volunteer developers to help this project come to fruition.
+
+## Did you find a bug?
+
+- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/lf-edge/ekuiper/issues).
+- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/lf-edge/ekuiper/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
+
+## Code and doc contribution
+
+Welcome to contribute code to provide features or fix bugs. 
+
+### One time setup
+
+We use GitHub pull request to review proposed code changes. So you'll need to obtain a GitHub account before making code contribution.
+
+1. **Fork** eKuiper to your private repository. Click the `Fork` button in the top right corner of eKuiper repository.
+2. **Clone** the repository locally from your personal fork. `git clone https://github.com/<Github_user>/ekuiper.git`.
+3. Add eKuiper repo as additional Git remote so that you can sync between local repo and eKuiper.
+  ```shell
+  git remote add upstream https://github.com/lf-edge/ekuiper.git
+  ```
+
+You can use your favorite IDE or editor to develop. You can find information in editor support for Go tools in [Editors and IDEs for GO](https://github.com/golang/go/wiki/IDEsAndTextEditorPlugins).
+
+### Create a branch in your fork
+
+You’ll work on your contribution in a branch in your own (forked) repository. Create a local branch, initialized with the state of the branch you expect your changes to be merged into. The `master` branch is active development branch, so it's recommended to set `master` as base branch.
+
+```shell
+$ git fetch upstream
+$ git checkout -b <my-branch> upstream/master
+```
+
+### Code conventions
+
+- Use `go fmt` to format your code before commit code change. eKuiper Github Action CI pipeline reports error if it's
+  not format by `go fmt`.
+- Configuration key in config files uses camel case format.
+
+### Debug your code
+
+Take GoLand as an example, developers can debug the code: 
+
+1. Debug the whole program. Make sure all directories mentioned in [Makefile](../../Makefile) build_prepare sections are created in your eKuiper root path. Add your breakpoints. Open `cmd/kuiperd/main.go`. In the main function, you'll find a green triangle in the ruler, click it and select debug. Then create your stream/rule that would run through your breakpoint, the debugger will pause there.
+2. To debug a small portion of code, we recommend writing a unit test and debug it. You can go to any test file and find the same green triangle to run in debug mode. For example, `pkg/cast/cast_test.go` TestMapConvert_Funcs can run as debug.
+
+### Testing
+
+The eKuiper project leverages Github actions to run unit test & FVT (functional verification test), so please take a
+look at the PR status result, and make sure that all of testcases run successfully.
+
+- Write Golang unit testcases to test your code if necessary.
+- A set of [FVT testcases](../../test/README.md) will be triggered with any PR submission, so please make sure that these
+  testcases can be run successfully.
+
+### Licensing
+
+All code contributed to eKuiper will be licensed under Apache License V2. You need to ensure every new files you are adding have the right license header.
+
+### Sign-off commit
+
+The sign-off is to certify the origin of the commit. It is required to commit to this project. If you set
+your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. Each commit must be signed off.
+
+### Syncing
+
+Periodically while you work, and certainly before submitting a pull request, you should update your branch with the most recent changes to the target branch. We prefer rebase than merge to avoid extraneous merge commits.
+
+```shell
+git fetch upstream
+git rebase upstream/master
+```
+
+Then you can push to your forked repo. Assume the remove name for your forked is the default `origin`. If you have rebased the git history before the last push, add `-f` to force pushing the changes.
+
+```shell
+git push origin -f
+```
+
+### Submitting changes
+
+The `master` branch is active development branch, so it's recommended to set `master` as base branch, and also create PR
+against `master` branch.
+
+Organize your commits to make a committer’s job easier when reviewing. Committers normally prefer multiple small pull requests, instead of a single large pull request. Within a pull request, a relatively small number of commits that break the problem into logical steps is preferred. For most pull requests, you'll squash your changes down to 1 commit. You can use the following command to re-order, squash, edit, or change description of individual commits.
+
+```shell
+git rebase -i upstream/master
+```
+
+Make sure all your commits comply to the [commit message guidelines](#commit-message-guidelines).
+
+You'll then push to your branch on your forked repo and then navigate to eKuiper repo to create a pull request. Our GitHub repo provides automatic testing with GitHub action. Please make sure those tests pass. We will review the code after all tests passed.
+
+### Commit Message Guidelines
+
+Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**:
+
+```
+<type>(<scope>): <subject>
+<BLANK LINE>
+<body>
+<BLANK LINE>
+<footer>
+```
+
+The **header** with **type** is mandatory. The **scope** of the header is optional. This repository has no predefined scopes. A custom scope can be used for clarity if desired.
+
+Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
+
+The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.
+
+Example 1:
+
+```
+feat: add Fuji release compose files
+```
+
+```
+fix(script): correct run script to use the right ports
+
+Previously device services used wrong port numbers. This commit fixes the port numbers to use the latest port numbers.
+
+Closes: #123, #245, #992
+```
+
+#### Revert
+
+If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
+
+#### Type
+
+Must be one of the following:
+
+- **feat**: New feature for the user, not a new feature for build script
+- **fix**: Bug fix for the user, not a fix to a build script
+- **docs**: Documentation only changes
+- **style**: Formatting, missing semi colons, etc; no production code change
+- **refactor**: Refactoring production code, eg. renaming a variable
+- **chore**: Updating grunt tasks etc; no production code change
+- **perf**: A code change that improves performance
+- **test**: Adding missing tests, refactoring tests; no production code change
+- **build**: Changes that affect the CI/CD pipeline or build system or external dependencies (example scopes: travis, jenkins, makefile)
+- **ci**: Changes provided by DevOps for CI purposes.
+- **revert**: Reverts a previous commit.
+
+#### Scope
+
+There are no predefined scopes for this repository. A custom scope can be provided for clarity.
+
+#### Subject
+
+The subject contains a succinct description of the change:
+
+- use the imperative, present tense: "change" not "changed" nor "changes"
+- don't capitalize the first letter
+- no dot (.) at the end
+
+#### Body
+
+Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
+
+#### Footer
+
+The footer should contain any information about **Breaking Changes** and is also the place to reference GitHub issues that this commit **Closes**.
+
+**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
+
+## Community Promotion
+
+Besides coding, other types of contributions are a great way to get involved. Welcome to contribute to this project by
+promoting it to the open source community and the world.
+
+The promotion contributions include but not limit to:
+
+- Integrate of eKuiepr to your open source project
+- Organize workshops or meetups about the project
+- Answer questions about the project on issues, slack or maillist
+- Write tutorials for how project can be used
+- Offer to mentor another contributor
+
+Thank you for taking the time to contribute!

File diff suppressed because it is too large
+ 59 - 0
docs/zh_CN/concepts/ekuiper.md


+ 23 - 0
docs/zh_CN/concepts/extensions.md

@@ -0,0 +1,23 @@
+# Extensions
+
+eKuiper provides built-in sources, sinks and functions as the building block for the rule. However, it is impossible to cover all external system for source/sink connection such as user's system with private protocol. Moreover, the built-in function cannot cover all the computation needed for all users. Thus, customized source, sink and functions are needed in many cases. eKuiper provide extension mechanism for users to customize all these three aspects.
+
+## Extension Points
+
+We support 3 extension points:
+
+- Source: add new source type for eKuiper to consume data from. The new extended source can be used in the stream/table definition.
+- Sink: add new sink type for eKuiper to produce data to. The new extended sink can be used in the rule actions definition.
+- Function: add new function type for eKuiper to process data. The new extended function can be used in the rule SQL.
+
+## Extension Types
+
+We support 3 kinds of extension:
+
+- [Go native plugin](../extension/native/overview.md): extend as a Go plugin. It is the most performant, but has a lot of limitation in development and deployment.
+- [Portable plugin](../extension/portable/overview.md) with Go or Python language, and it will support more languages later. It simplifies the development and deployment and has less limitations.
+- [External service](../extension/external/external_func.md): wrap existing external REST or rpc services as a eKuiper SQL function by configurations. It is a speedy way to extend by existing services. But it only supports function extension.
+
+## More Readings
+
+- [Extension Reference](../extension/overview.md)

+ 19 - 0
docs/zh_CN/concepts/rules.md

@@ -0,0 +1,19 @@
+# Rules
+
+Each rule represents a computing job to run in eKuiper. It defines the continuous streaming data source as the input, the computing logic and the result actions as the output.
+
+## Rule Lifecycle
+
+Currently, eKuiper only supports stream processing rule, which means that at lease one of the rule source must be a continuous stream. Thus, the rule will run continuously once started and only stopped if the user send stop command explicitly. The rule may stop abnormally for errors or the eKuiper instance exits.
+
+## Rules Relationship
+
+It is common to run multiple rules simultaneously. As eKuiper is a single instance process, the rules are running in the same memory space. However, there are separated in the runtime and the error in one rule should not affect others. Regarding workload, all rules share the same hardware resource. Each rule can specify the operator buffer to limit the processing rate to avoid taking all resources.
+
+## Rule Pipeline
+
+Multiple rules can form a processing pipeline by specifying a joint point in sink/source. For example, the first rule produce the result to a topic in memory sink and the other rule subscribe to that topic in its memory source. Besides the pair of memory sink/source, users can also use mqtt or other sink/source pair to connect rules.
+
+## More Readings
+
+- [Rule Reference](../rules/overview.md)

+ 13 - 0
docs/zh_CN/concepts/sinks.md

@@ -0,0 +1,13 @@
+# Sinks
+
+Sinks are used to write data to an external system. Sinks can be used to write control data to trigger an action. Sinks can also be used to write status data and save in an external storage.
+
+In a rule, the sink type are used as an action. A rule can have more than one actions and the differenct actions can be the same sink type.
+
+## Result Encoding
+
+The sink result is a string as always. It will be encoded into json string by default. Users can change the format by setting `dataTemplate` which leverage the go template syntax to format the result into a string. For even detail control of the result format, users can develop a sink extension.
+
+## More Readings
+
+- [Sink Reference](../rules/sinks/overview.md)

+ 30 - 0
docs/zh_CN/concepts/sources/overview.md

@@ -0,0 +1,30 @@
+# Sources
+
+Sources are used to read data from external systems. The source can be unbounded streaming data named stream or bounded batch data named table. When using in a rule, at least one of  the source must be a stream.
+
+The source basically defines how to connect to an external resource and fetch data from the resource in a streaming way. After fetching the data, common tasks like decode and transform by schema can be done by setting properties.
+
+## Define and Run
+
+When define a source stream or table, it actually creates the logical definition instead of a physical running data input. The logical definition can then be used in rule's SQL in the `from` clause. The source only starts to run when any of the rules refer to it has started.
+
+By default, if multiple rules refer to the same source. Each rule will have its own, standalone source instance from other rules so that the rules are total separated. To boost performance when users want to process the same data across multiple rules, they can define the source as shared. Then the rules refer to the same shared source will share the same running source instance.
+
+## Decode
+
+Users can define the format to decode by setting `format` property. Currently, only `json` and `binary` format are supported. For other formats, customized source must be developed.
+
+## Schema
+
+Users can define the data schema like a common SQL table. In eKuiper runtime, the data will be validated and transformed according to the schema. To avoid conversion overhead if the data is fixed and clean or to consume unknown schema data, users can define schemaless source.
+
+## Stream & Table
+
+The source defines the external system connection. When using in a rule, users can define them as stream or table according to the processing mechanism. Check [stream](stream.md) and [table](table.md) for detail.
+
+## More Readings
+
+- [Source Reference](../../rules/sources/overview.md)
+
+
+

+ 10 - 0
docs/zh_CN/concepts/sources/stream.md

@@ -0,0 +1,10 @@
+# Stream
+
+A stream is the runtime form of a source in eKuiper. It must specify a source type to define how to connect to the external resource.
+
+When using as a stream, the source must be unbounded. The stream acts like a trigger for the rule. Each event will trigger a calculation in the rule.
+
+## More Readings
+
+- [Stream Reference](../../sqls/streams.md)
+

+ 17 - 0
docs/zh_CN/concepts/sources/table.md

@@ -0,0 +1,17 @@
+# Table
+
+In eKuiper, a table is a snapshot of the source data. In contrast to the common static tables that represent batch data, eKuiper tables can change over time.
+
+The source for table can be either bounded or unbounded. For bounded source table, the content of the table is static. For unbounded table, the content of the table is dynamic.
+
+## Table Updates
+
+Currently, the table update in eKuiper is append-only. Users can specify the properties to limit the table size to avoid too much memory consumption.
+
+## Table Usages
+
+Table cannot be used standalone in a rule. It is usually used to join with streams. It can be used to enrich stream data or as a switch for calculation.
+
+## More Readings
+
+- [Table Reference](../../sqls/tables.md)

+ 11 - 0
docs/zh_CN/concepts/sql.md

@@ -0,0 +1,11 @@
+# SQL
+
+The SQL language support in eKuiper includes Data Definition Language (DDL), Data Manipulation Language (DML) and Query Language. The SQL support in eKuiper is a subset of ANSI SQL and has some customized extensions.
+
+## SQL in source definition
+
+When create and manage stream or table source, SQL DDL and DML are used as the command payload. Check [streams](../sqls/streams.md) and [tables](../sqls/tables.md) for detail.
+
+## SQL queries in rules
+
+In rules, SQL queries are used to define the business logic. Please check [sql reference](../sqls/overview.md) for detail.

+ 10 - 0
docs/zh_CN/concepts/streaming/join.md

@@ -0,0 +1,10 @@
+# Join of sources
+
+Currently, join is the only way to merge multiple sources in eKuiper. It requires a way to align multiple sources and trigger the join result.
+
+The supported joins in eKuiper include:
+
+- Join of streams: must do in a window.
+- Join of stream and table: the stream will be the trigger of join operation.
+
+The supported join type includes LEFT, RIGHT, FULL & CROSS in eKuiper.

File diff suppressed because it is too large
+ 31 - 0
docs/zh_CN/concepts/streaming/overview.md


File diff suppressed because it is too large
+ 18 - 0
docs/zh_CN/concepts/streaming/time.md


+ 12 - 0
docs/zh_CN/concepts/streaming/windowing.md

@@ -0,0 +1,12 @@
+# Windowing
+
+As streaming data is infinite, it is impossible to process it as a whole. Windowing provides a mechanism to split the unbounded data into a continuous series of bounded data to calculate.
+
+In eKuiper, the built-in windowing supports:
+
+- Time window: window split by time
+- Count window: window split by element count
+
+In time window, both processing time and event time are supported.
+
+For all the supported window type, please check [window functions](../../sqls/windows.md).

+ 35 - 3
docs/zh_CN/extension/native/overview.md

@@ -16,8 +16,8 @@ eKuiper 允许用户自定义扩展,以支持更多的功能。用户可编写
 
 eKuiper 允许用户自定义不同类型的扩展。 
 
-- 源扩展用于扩展不同的流源,例如使用来自其他消息服务器的数据。eKuiper 对 [MQTT 消息服务器](../../rules/sources/mqtt.md)的内置源提供支持。
-- Sink/Action 扩展用于将发布/推送数据扩展到不同的目标,例如数据库,其他消息系统,Web 界面或文件系统。eKuiper 中提供内置动作支持,请参阅  [MQTT](../../rules/sinks/mqtt.md)  & [日志文件](../../rules/sinks/log.md).。
+- 源扩展用于扩展不同的流源,例如使用来自其他消息服务器的数据。eKuiper 对 [MQTT 消息服务器](../../rules/sources/builtin/mqtt.md)的内置源提供支持。
+- Sink/Action 扩展用于将发布/推送数据扩展到不同的目标,例如数据库,其他消息系统,Web 界面或文件系统。eKuiper 中提供内置动作支持,请参阅  [MQTT](../../rules/sinks/builtin/mqtt.md)  & [日志文件](../../rules/sinks/builtin/log.md).。
 - 函数扩展允许用户扩展 SQL 中使用的不同函数。 eKuiper支持内置函数,请参见 [函数](../../sqls/built-in_functions.md)。
 
 请阅读以下内容,了解如何实现不同的扩展。
@@ -32,6 +32,38 @@ eKuiper 允许用户自定义不同类型的扩展。
 1. 插件输出变量必须为**插件名的首字母大写形式**。 例如,插件名为 _file_ ,则其输出变量名必须为 _File_。
 2. _.so_ 文件的名字必须与输出变量名或者插件名相同。例如, _MySource.so_ 或 _mySink.so_。
 
+### Version
+
+The user can **optionally** add a version string to the name of _.so_ to help identify the version of the plugin. The version can be then retrieved through describe CLI command or REST API. The naming convention is to add a version string to the name after _@_. The version can be any string. If the version string starts with "v", the "v" will be ignored in the return result. Below are some typical examples.
+
+- _MySource@v1.0.0.so_ : version is 1.0.0
+- _MySource@20200331.so_:  version is 20200331
+
+If multiple versions of plugins with the same name in place, only the latest version(ordered by the version string) will be taken effect.
+
+## Setup the plugin developing environment
+
+It is required to build the plugin with exactly the same version of dependencies. And the plugin must implement interfaces exported by Kuiper, so the Kuiper project must be in the gopath.
+
+A typical environment for developing plugins is to put the plugin and Kuiper in the same project. To set it up:
+1. Clone Kuiper project.
+2. Create the plugin implementation file inside plugins/sources or plugin/sinks or plugin/functions according to what extension type is developing.
+3. Build the file as plugin into the same folder. The build command is typically like:
+```bash
+go build -trimpath --buildmode=plugin -o plugins/sources/MySource.so plugins/sources/my_source.go
+```
+
+Notice that, the `-trimpath` build flag is required if using the prebuilte kuiper or kuiper docker image because the kuiperd is also built with the flag to improve build reproducibility.
+
+### Plugin development
+
+The development of plugins is to implement a specific interface according to the plugin type and export the implementation with a specific name. There are two types of exported symbol supported:
+
+1. Export a constructor function: Kuiper will use the constructor function to create a new instance of the plugin implementation for each load. So each rule will have one instance of the plugin and each instance will be isolated from others. This is the recommended way.
+
+2. Export an instance: Kuiper will use the instance as singleton for all plugin load. So all rules will share the same instance. For such implementation, the developer will need to handle the shared states to avoid any potential multi-thread problems. This mode is recommended where there are no shared states and the performance is critical. Especially, function extension is usually functional without internal state which is suitable for this mode.
+
+
 ## 状态存储
 
 eKuiper 扩展通过 context 参数暴露了一个基于键值对的状态存储接口,可用于所有类型的扩展,包括 Source,Sink 和 Function 扩展.
@@ -59,7 +91,7 @@ func (f *accumulateWordCountFunc) Exec(args []interface{}, ctx api.FunctionConte
 
 ### 运行时依赖
 
-有些插件可能需要访问文件系统中的依赖文件。依赖文件建放置于 {{ekuiperPath}}/etc/{{pluginType}}/{{pluginName}} 目录。打包插件时,依赖文件应放置于 [etc 目录](../../operation/restapi/plugins.md#plugin-file-format)。安装后,这些文件会自动移动到推荐的位置。
+有些插件可能需要访问文件系统中的依赖文件。依赖文件建放置于 {{ekuiperPath}}/etc/{{pluginType}}/{{pluginName}} 目录。打包插件时,依赖文件应放置于 [etc 目录](../../operation/restapi/plugins.md#插件文件格式)。安装后,这些文件会自动移动到推荐的位置。
 
 在插件源代码中,开发者可通过 context 获取 eKuiper 根目录,以访问文件系统中的依赖:
 

+ 0 - 58
docs/zh_CN/extension/native/sinks/redis.md

@@ -1,58 +0,0 @@
-# Redis 目标(Sink)
-
-该插件将分析结果发送到 Redis 中。
-## 编译插件&创建插件
-
-redis 源代码在 extensions 目录中,但是需要在 eKuiper 根目录编译
-```shell
-# cd $eKuiper_src
-# go build -trimpath -modfile extensions.mod --buildmode=plugin -o plugins/sinks/Redis.so extensions/sinks/redis/redis.go
-# zip redis.zip plugins/sinks/Redis.so
-# cp redis.zip /root/tomcat_path/webapps/ROOT/
-# bin/kuiper create plugin sink redis -f /tmp/redisPlugin.txt
-# bin/kuiper create rule redis -f /tmp/redisRule.txt
-```
-
-重新启动 eKuiper 服务器以激活插件。
-
-## 属性
-
-| 属性名称     | 是否必填 | 说明                     |
-| ------------ | -------- | ------------------------ |
-| addr          | 是     | Redis 的地址, 例如: 10.122.48.17:6379 |
-| password      | 否     | Redis 登陆密码 |
-| db            | 是     | Redis 的数据库,例如0 |
-| key           | 是     | Redis 数据的 Key, key 与 field 选择其中一个, 优先 field |
-| field         | 否     | json 数据某一个属性,配置它作为 redis 数据的 key 值, 例如 deviceName, 该字段必须存在且为 string 类型,否则以 field 字符作为 key。比如 field 属性为 "deviceName", 收到 {“deviceName":"abc"}, 那么存入redis用的key是 "abc"; 收到 {“deviceName": 2}, 那么存入redis用的key是 "deviceName"。 注意:配置该值不要使用数据模板 |
-| dataType      | 是     | Redis 数据的类型, 默认是 string, 注意修改类型之后,需在redis中删除原有 key,否则修改无效。目前只支持 "list" 和 "string" |
-| expiration    | 是     | 超时时间
-## 示例用法
-
-下面是选择温度大于50度的样本规则,和一些配置文件仅供参考。
-
-### ####/tmp/redis.txt
-```json
-{
-  "id": "redis",
-  "sql": "SELECT * from  demo_stream where temperature > 50",
-  "actions": [
-    {
-      "log": {},
-      "redis":{
-        "addr": "tcp://10.122.48.17:6379",
-        "password": "123456",
-        "db": "1",
-        "dataType": "string",
-        "expire": "10000",
-        "field": "temperature"
-      }
-    }
-  ]
-}
-```
-### ####/tmp/redisPlugin.txt
-```json
-{
-  "file":"http://localhost:8080/redis.zip"
-}
-```

File diff suppressed because it is too large
+ 2 - 2
docs/zh_CN/operation/restapi/plugins.md


File diff suppressed because it is too large
+ 78 - 7
docs/zh_CN/reference.md


+ 16 - 16
docs/zh_CN/rules/sinks/edgex.md

@@ -6,22 +6,22 @@
 
 **另外,如果你需要在别的主机上对你的端口可以进行访问,你需要在开始运行 eKuiper 服务之前,把端口号映射到主机上。**
 
-| 名称                 | 可选  | Description                                                                                                                                                                      |
-|--------------------|-----|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| type               | 是   | 消息总线类型,目前支持三种类型的消息总线, `redis`, `zero` 或者 `mqtt`,其中 `redis` 为缺省类型。                                                                                                                |
-| protocol           | 是   | 协议,如未指定,使用缺省值 `tcp` 。                                                                                                                                                            |
-| host               | 是   | 消息总线主机地址,使用缺省值 `*` 。                                                                                                                                                             |
-| port               | 是   | 消息总线端口号。 如未指定,使用缺省值 `5563` 。                                                                                                                                                     |
-| connectionSelector | 是   | 重用到 EdgeX 消息总线的连接,详细信息,[请参考](../sources/edgex.md#connectionselector)                                                                                                             |
-| topic              | 是   | 发布的主题名称。该主题为固定值。若不同的消息需要动态指定主题,则将该属性置空,并设置 topicPrefix 属性。这两个属性只能设置一个。若两者都未设置,则使用缺省主题 `application` 。                                                                            |
-| topicPrefix        | 是   | 发布的主题的前缀。发送的主题将采用动态拼接,格式为`$topicPrefix/$profileName/$deviceName/$sourceName` 。                                                                                                   |
-| contentType        | 是   | 发布消息的内容类型,如未指定,使用缺省值 `application/json` 。                                                                                                                                        |
+| 名称                 | 可选  | Description                                                                                                                                                                    |
+|--------------------|-----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| type               | 是   | 消息总线类型,目前支持三种类型的消息总线, `redis`, `zero` 或者 `mqtt`,其中 `redis` 为缺省类型。                                                                                                              |
+| protocol           | 是   | 协议,如未指定,使用缺省值 `tcp` 。                                                                                                                                                          |
+| host               | 是   | 消息总线主机地址,使用缺省值 `*` 。                                                                                                                                                           |
+| port               | 是   | 消息总线端口号。 如未指定,使用缺省值 `5563` 。                                                                                                                                                   |
+| connectionSelector | 是   | 重用到 EdgeX 消息总线的连接,详细信息,[请参考](../../sources/builtin/edgex.md#connectionselector)                                                                                                |
+| topic              | 是   | 发布的主题名称。该主题为固定值。若不同的消息需要动态指定主题,则将该属性置空,并设置 topicPrefix 属性。这两个属性只能设置一个。若两者都未设置,则使用缺省主题 `application` 。                                                                          |
+| topicPrefix        | 是   | 发布的主题的前缀。发送的主题将采用动态拼接,格式为`$topicPrefix/$profileName/$deviceName/$sourceName` 。                                                                                                 |
+| contentType        | 是   | 发布消息的内容类型,如未指定,使用缺省值 `application/json` 。                                                                                                                                      |
 | messageType        | 是   | EdgeX 消息模型类型。若要将消息发送为类似 apllication service 的 event 类型,则应设置为 `event`。否则,若要将消息发送为类似 device service 或者 core data service 的 event request 类型,则应设置为 `request`。如未指定,使用缺省值 `event` 。 |
-| metadata           | 是   | 该属性为一个字段名称,该字段是 SQL SELECT 子句的一个字段名称,这个字段应该类似于 `meta(*) AS xxx` ,用于选出消息中所有的 EdgeX 元数据 。                                                                                          |
-| profileName        | 是   | 允许用户指定 Profile 名称,该名称将作为从 eKuiper 中发送出来的 Event 结构体的 profile 名称。若在 metadata 中设置了 profileName 将会优先采用。                                                                              |
-| deviceName         | 是   | 允许用户指定设备名称,该名称将作为从 eKuiper 中发送出来的 Event 结构体的设备名称。若在 metadata 中设置了 deviceName 将会优先采用。                                                                                             |
-| sourceName         | 是   | 允许用户指定源名称,该名称将作为从 eKuiper 中发送出来的 Event 结构体的源名称。若在 metadata 中设置了 sourceName 将会优先采用。                                                                                               |
-| optional           | 是   | 如果指定了 `mqtt` 消息总线,那么还可以指定一下可选的值。请参考以下可选的支持的配置类型。                                                                                                                                 |
+| metadata           | 是   | 该属性为一个字段名称,该字段是 SQL SELECT 子句的一个字段名称,这个字段应该类似于 `meta(*) AS xxx` ,用于选出消息中所有的 EdgeX 元数据 。                                                                                        |
+| profileName        | 是   | 允许用户指定 Profile 名称,该名称将作为从 eKuiper 中发送出来的 Event 结构体的 profile 名称。若在 metadata 中设置了 profileName 将会优先采用。                                                                            |
+| deviceName         | 是   | 允许用户指定设备名称,该名称将作为从 eKuiper 中发送出来的 Event 结构体的设备名称。若在 metadata 中设置了 deviceName 将会优先采用。                                                                                           |
+| sourceName         | 是   | 允许用户指定源名称,该名称将作为从 eKuiper 中发送出来的 Event 结构体的源名称。若在 metadata 中设置了 sourceName 将会优先采用。                                                                                             |
+| optional           | 是   | 如果指定了 `mqtt` 消息总线,那么还可以指定一下可选的值。请参考以下可选的支持的配置类型。                                                                                                                               |
 
 以下为支持的可选的配置列表,您可以参考 MQTT 协议规范来获取更详尽的信息。
 
@@ -144,7 +144,7 @@
 
 ## 使用连接重用功能发布
 
-以下是如何使用连接重用功能的示例。我们只需要删除连接相关的参数并使用 `connectionSelector` 指定要重用的连接。 [更多信息](../sources/edgex.md#connectionselector)
+以下是如何使用连接重用功能的示例。我们只需要删除连接相关的参数并使用 `connectionSelector` 指定要重用的连接。 [更多信息](../../sources/builtin/edgex.md#connectionselector)
 
 ```json
 {

docs/zh_CN/rules/sinks/log.md → docs/zh_CN/rules/sinks/builtin/log.md


+ 1 - 1
docs/zh_CN/rules/sinks/memory.md

@@ -1,6 +1,6 @@
 # 内存动作
 
-该动作用于将结果刷新到内存中的主题中,以便 [内存源](../sources/memory.md) 可以使用它。 该主题类似于 pubsub 主题,例如 mqtt,因此可能有多个内存目标发布到同一主题,也可能有多个内存源订阅同一主题。 内存动作的典型用途是形成[规则管道](../rule_pipeline.md)。
+该动作用于将结果刷新到内存中的主题中,以便 [内存源](../../sources/builtin/memory.md) 可以使用它。 该主题类似于 pubsub 主题,例如 mqtt,因此可能有多个内存目标发布到同一主题,也可能有多个内存源订阅同一主题。 内存动作的典型用途是形成[规则管道](../../rule_pipeline.md)。
 
 | 属性名称  | 是否可选 | 描述                                  |
 |-------|------|-------------------------------------|

+ 1 - 1
docs/zh_CN/rules/sinks/mqtt.md

@@ -16,7 +16,7 @@
 | rootCaPath         | 是    | 根证书路径,用以验证服务器证书。可以为绝对路径,也可以为相对路径,相对路径的用法与 `certificationPath` 类似。                                                                                                                         |
 | insecureSkipVerify | 是    | 如果 InsecureSkipVerify 设置为 `true`, TLS接受服务器提供的任何证书以及该证书中的任何主机名。 在这种模式下,TLS容易受到中间人攻击。默认值为`false`。配置项只能用于TLS连接。                                                                              |
 | retained           | 是    | 如果 retained 设置为 `true`,Broker会存储每个Topic的最后一条保留消息及其Qos。默认值是 `false`                                                                                                                        |
-| connectionSelector | 是    | 重用到 MQTT Broker 的连接,详细信息,[请参考](../sources/mqtt.md#connectionselector)                                                                                                                     |
+| connectionSelector | 是    | 重用到 MQTT Broker 的连接,详细信息,[请参考](../../sources/builtin/mqtt.md#connectionselector)                                                                                                          |
 
 以下为使用 SAS 连接到 Azure IoT Hub 的样例。
 ```json

docs/zh_CN/rules/sinks/nop.md → docs/zh_CN/rules/sinks/builtin/nop.md


File diff suppressed because it is too large
+ 1 - 1
docs/zh_CN/rules/sinks/rest.md


+ 29 - 0
docs/zh_CN/rules/sinks/overview.md

@@ -0,0 +1,29 @@
+# Available Sinks
+
+In the eKuiper source code, there are built-in sinks and sinks in extension.
+
+## Built-in Sinks
+
+Users can directly use the built-in sinks in the standard eKuiper instance. The list of built-in sinks are:
+
+- [Mqtt sink](./builtin/mqtt.md): sink to external mqtt broker
+- [EdgeX sink](./builtin/edgex.md): sink to EdgeX Foundry. This sink only exist when enabling edgex build tag.
+- [Rest sink](./builtin/rest.md): sink to external http server.
+- [Memory sink](./builtin/memory.md): sink to eKuiper memory topic to form rule pipelines.
+- [Log sink](./builtin/log.md): sink to log, usually for debug only.
+- [Nop sink](./builtin/nop.md): sink to nowhere. It is used for performance testing now.
+
+## Predefined Sink Plugins
+
+We have developed some official sink plugins. These plugins can be found in eKuiper's source code and users need to build them manually. Please check each sink about how to build and use.
+
+Additionally, these plugins have pre-built binaries for the mainstream cpu architecture such as AMD or ARM. The pre-built plugin hosted in `https://packages.emqx.net/kuiper-plugins/$version/$os/sinks/$type_$arch.zip`. For example, to get tdengine sink for debian amd64, install it from `https://packages.emqx.net/kuiper-plugins/1.4.4/debian/sinks/tdengine_amd64.zip`.
+
+The list of predefined sink plugins:
+
+- [Zero MQ sink](./plugin/zmq.md): sink to zero mq.
+- [File sink](./plugin/file.md): sink to a file.
+- [InfluxDB sink](./plugin/influx.md): sink to influx db.
+- [Tdengine sink](./plugin/tdengine.md): sink to tdengine.
+- [Redis sink](./plugin/redis.md): sink to redis.
+- [Image sink](./plugin/image.md): sink to an image file. Only used to handle binary result.

docs/zh_CN/extension/native/sinks/file.md → docs/zh_CN/rules/sinks/plugin/file.md


docs/zh_CN/extension/native/sinks/image.md → docs/zh_CN/rules/sinks/plugin/image.md


docs/zh_CN/extension/native/sinks/influx.md → docs/zh_CN/rules/sinks/plugin/influx.md


+ 59 - 0
docs/zh_CN/rules/sinks/plugin/redis.md

@@ -0,0 +1,59 @@
+# Redis 目标(Sink)
+
+该插件将分析结果发送到 Redis 中。
+## 编译插件&创建插件
+
+redis 源代码在 extensions 目录中,但是需要在 eKuiper 根目录编译
+```shell
+# cd $eKuiper_src
+# go build -trimpath -modfile extensions.mod --buildmode=plugin -o plugins/sinks/Redis.so extensions/sinks/redis/redis.go
+# zip redis.zip plugins/sinks/Redis.so
+# cp redis.zip /root/tomcat_path/webapps/ROOT/
+# bin/kuiper create plugin sink redis -f /tmp/redisPlugin.txt
+# bin/kuiper create rule redis -f /tmp/redisRule.txt
+```
+
+重新启动 eKuiper 服务器以激活插件。
+
+## 属性
+
+| 属性名称       | 是否必填 | 说明                                                                                                                                                                                                                                       |
+|------------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| addr       | 是    | Redis 的地址, 例如: 10.122.48.17:6379                                                                                                                                                                                                         |
+| password   | 否    | Redis 登陆密码                                                                                                                                                                                                                               |
+| db         | 是    | Redis 的数据库,例如0                                                                                                                                                                                                                           |
+| key        | 是    | Redis 数据的 Key, key 与 field 选择其中一个, 优先 field                                                                                                                                                                                              |
+| field      | 否    | json 数据某一个属性,配置它作为 redis 数据的 key 值, 例如 deviceName, 该字段必须存在且为 string 类型,否则以 field 字符作为 key。比如 field 属性为 "deviceName", 收到 {“deviceName":"abc"}, 那么存入redis用的key是 "abc"; 收到 {“deviceName": 2}, 那么存入redis用的key是 "deviceName"。 注意:配置该值不要使用数据模板 |
+| dataType   | 是    | Redis 数据的类型, 默认是 string, 注意修改类型之后,需在redis中删除原有 key,否则修改无效。目前只支持 "list" 和 "string"                                                                                                                                                        |
+| expiration | 是    | 超时时间                                                                                                                                                                                                                                     |
+
+## 示例用法
+
+下面是选择温度大于50度的样本规则,和一些配置文件仅供参考。
+
+### ####/tmp/redis.txt
+```json
+{
+  "id": "redis",
+  "sql": "SELECT * from  demo_stream where temperature > 50",
+  "actions": [
+    {
+      "log": {},
+      "redis":{
+        "addr": "tcp://10.122.48.17:6379",
+        "password": "123456",
+        "db": "1",
+        "dataType": "string",
+        "expire": "10000",
+        "field": "temperature"
+      }
+    }
+  ]
+}
+```
+### ####/tmp/redisPlugin.txt
+```json
+{
+  "file":"http://localhost:8080/redis.zip"
+}
+```

docs/zh_CN/extension/native/sinks/tdengine.md → docs/zh_CN/rules/sinks/plugin/tdengine.md


docs/zh_CN/extension/native/sinks/zmq.md → docs/zh_CN/rules/sinks/plugin/zmq.md


+ 2 - 2
docs/zh_CN/rules/sources/edgex.md

@@ -19,7 +19,7 @@ EdgeX 源会试图取得某个字段的类型,
 - 如果在 reading 的值类型中可找不到到其数据类型,将保留原值;
 - 如果类型转换失败,该值将被**丢弃**,并在日志上打印一条告警消息;
 
-在 readings 中定义的数据类型,将被转换为 eKuiper 中相应支持的[数据类型](../../sqls/streams.md)。
+在 readings 中定义的数据类型,将被转换为 eKuiper 中相应支持的[数据类型](../../../sqls/streams.md)。
 
 ### Boolean
 
@@ -180,7 +180,7 @@ demo1: #Conf_key
   topic: events
 ```
 
-如果你有个特定的源需要覆盖缺省的设置,你可以定义一个自定义的配置段。在上面的例子中,我们创建了一个新的配置 `demo1`,然后你在创建流定义的时候可以使用选项 `CONF_KEY` 来使用新的配置 (参考 [流定义规范](../../sqls/streams.md) 获取更多详细信息)。
+如果你有个特定的源需要覆盖缺省的设置,你可以定义一个自定义的配置段。在上面的例子中,我们创建了一个新的配置 `demo1`,然后你在创建流定义的时候可以使用选项 `CONF_KEY` 来使用新的配置 (参考 [流定义规范](../../../sqls/streams.md) 获取更多详细信息)。
 
 **例子**
 

+ 2 - 2
docs/zh_CN/rules/sources/file.md

@@ -1,6 +1,6 @@
 ## 文件源
 
-eKuiper 提供了内置支持,可将文件内容读入 eKuiper 处理管道。 文件源通常用作 [表格](../../sqls/tables.md), 并且采用 create table 语句的默认类型。
+eKuiper 提供了内置支持,可将文件内容读入 eKuiper 处理管道。 文件源通常用作 [表格](../../../sqls/tables.md), 并且采用 create table 语句的默认类型。
 
 ```sql
 CREATE TABLE table1 (
@@ -10,7 +10,7 @@ CREATE TABLE table1 (
 ) WITH (DATASOURCE="lookup.json", FORMAT="json", TYPE="file");
 ```
 
-您可以使用 [cli](../../operation/cli/tables.md) 或 [rest api](../../operation/restapi/tables.md) 来管理表
+您可以使用 [cli](../../../operation/cli/tables.md) 或 [rest api](../../../operation/restapi/tables.md) 来管理表
 
 文件源的配置文件是 */etc/sources/file.yaml* ,可以在其中指定文件的路径。
 

+ 1 - 1
docs/zh_CN/rules/sources/http_pull.md

@@ -84,7 +84,7 @@ http 请求的超时时间,单位为 ms。
 
 ## 重载默认设置
 
-如果您有特定的连接需要重载默认设置,则可以创建一个自定义部分。 在上一个示例中,我们创建了一个名为 `application_conf` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [流规格](../../sqls/streams.md))。
+如果您有特定的连接需要重载默认设置,则可以创建一个自定义部分。 在上一个示例中,我们创建了一个名为 `application_conf` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [流规格](../../../sqls/streams.md))。
 
 **样例**
 

+ 1 - 1
docs/zh_CN/rules/sources/memory.md

@@ -1,6 +1,6 @@
 # 内存源
 
-内存源通过主题消费由 [内存目标](../sinks/memory.md) 生成的事件。该主题类似于 pubsub 主题,例如 mqtt,因此可能有多个内存目标发布到同一主题,也可能有多个内存源订阅同一主题。 内存动作的典型用途是形成[规则管道](../rule_pipeline.md)。
+内存源通过主题消费由 [内存目标](../../sinks/builtin/memory.md) 生成的事件。该主题类似于 pubsub 主题,例如 mqtt,因此可能有多个内存目标发布到同一主题,也可能有多个内存源订阅同一主题。 内存动作的典型用途是形成[规则管道](../../rule_pipeline.md)。
 
 主题没有配置属性,由流数据源属性指定,如以下示例所示:
 

+ 1 - 1
docs/zh_CN/rules/sources/mqtt.md

@@ -143,7 +143,7 @@ kubeedge 模版文件名,文件指定放在 etc/sources 文件夹中,样例
 
 ## 重载默认设置
 
-如果您有一个特定连接需要重载默认设置,则可以创建一个自定义模块。 在上一个示例中,我们创建一个名为 `demo` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [stream specs](../../sqls/streams.md) )。
+如果您有一个特定连接需要重载默认设置,则可以创建一个自定义模块。 在上一个示例中,我们创建一个名为 `demo` 的特定设置。 然后,您可以在创建流定义时使用选项 `CONF_KEY` 指定配置(有关更多信息,请参见 [stream specs](../../../sqls/streams.md) )。
 
 **示例**
 

+ 24 - 0
docs/zh_CN/rules/sources/overview.md

@@ -0,0 +1,24 @@
+# Available Sources
+
+In the eKuiper source code, there are built-in sources and sources in extension.
+
+## Built-in Sources
+
+Users can directly use the built-in sources in the standard eKuiper instance. The list of built-in sources are:
+
+- [Mqtt source](./builtin/mqtt.md): read data from mqtt topics.
+- [EdgeX source](./builtin/edgex.md): read data from EdgeX foundry.
+- [Http pull source](./builtin/http_pull.md): source to pull data from http servers.
+- [Memory source](./builtin/memory.md): source to read from eKuiper memory topic to form rule pipelines.
+- [File source](./builtin/file.md): source to read from file, usually used as tables.
+
+## Predefined Source Plugins
+
+We have developed some official source plugins. These plugins can be found in eKuiper's source code and users need to build them manually. Please check each source about how to build and use.
+
+Additionally, these plugins have pre-built binaries for the mainstream cpu architecture such as AMD or ARM. The pre-built plugin hosted in `https://packages.emqx.net/kuiper-plugins/$version/$os/sources/$type_$arch.zip`. For example, to get zmq source for debian amd64, install it from `https://packages.emqx.net/kuiper-plugins/1.4.4/debian/sources/zmq_amd64.zip`.
+
+The list of predefined source plugins:
+
+- [Zero MQ source](./plugin/zmq.md): read data from zero mq.
+- [Random source](./plugin/random.md): a source to generate random data for testing.

docs/zh_CN/extension/native/sources/random.md → docs/zh_CN/rules/sources/plugin/random.md


docs/zh_CN/extension/native/sources/zmq.md → docs/zh_CN/rules/sources/plugin/zmq.md


+ 3 - 3
docs/zh_CN/extension/native/functions/functions.md

@@ -1,11 +1,11 @@
 # 定制函数
 
-eKuiper 可以定制函数,函数的开发、编译及使用请[参见这里](../develop/function.md)。
+eKuiper 可以定制函数,函数的开发、编译及使用请[参见这里](../extension/native/develop/function.md)。
 
 ## echo 插件
 
-| 函数 | 示例      | 说明           |
-| ---- | --------- | -------------- |
+| 函数   | 示例        | 说明      |
+|------|-----------|---------|
 | echo | echo(avg) | 原样输出参数值 |
 
 echo(avg) 示例

+ 3 - 3
docs/zh_CN/extension/native/functions/tensorflow_lite_tutorial.md

@@ -55,13 +55,13 @@ var LabelImage = labelImage{
 }
 ```
 
-查阅 [本教程](../develop/plugins_tutorial.md) 以获得创建 eKuiper 插件的详细步骤。请参阅 [labelImage.go](https://github.com/lf-edge/ekuiper/blob/master/extensions/functions/labelImage/labelImage.go) 以获取完整的源代码。
+查阅 [本教程](../../extension/native/develop/plugins_tutorial.md) 以获得创建 eKuiper 插件的详细步骤。请参阅 [labelImage.go](https://github.com/lf-edge/ekuiper/blob/master/extensions/functions/labelImage/labelImage.go) 以获取完整的源代码。
 
 ## 构建并安装插件
 
 要使用该插件,我们需要在运行 eKuiper 的环境中对其进行构建,然后将其安装在 eKuiper 中。
 
-### 通过预构建的  zip 安装
+### 通过预构建的 zip 安装
 
 如果使用基于 debian 的带有 1.1.1 或 1.1.1-slim标签的 eKuiper docker 镜像,我们可以安装预构建的 labelImage插件。 例如,要在 docker image lfedge/ekuiper:1.1.2-slim 中安装 eKuiper 1.1.2 插件,则预构建的 zip 文件位于 *https://www.emqx.io/downloads/kuiper-plugins/v1.1.2/debian/functions/labelImage_amd64.zip*。 按如下所示运行 rest命令以进行安装。
 
@@ -138,7 +138,7 @@ $ cp -r extensions/functions/labelImage plugins/functions
 - LabelImage.so
 - tflite.conf
 
-将打包的插件安装到目标系统,如 [通过预构建 zip 安装](#install-by-pre-built-zip) 所示。
+将打包的插件安装到目标系统,如 [通过预构建 zip 安装](#通过预构建的-zip-安装) 所示。
 
 ## 运行插件
 

docs/zh_CN/deploy/add_service.png → docs/zh_CN/tutorials/deploy/add_service.png


docs/zh_CN/deploy/ekuiper_openyurt.png → docs/zh_CN/tutorials/deploy/ekuiper_openyurt.png


docs/zh_CN/deploy/kmanager.yaml → docs/zh_CN/tutorials/deploy/kmanager.yaml


+ 3 - 3
docs/zh_CN/deploy/openyurt_tutorial.md

@@ -1,6 +1,6 @@
 # 使用 OpenYurt 部署和管理 eKuiper
 
-LF Edge eKuiper 是轻量级物联网数据分析和流处理软件,通常在边缘端运行。 它提供了一个 [管理仪表板](../operation/manager-ui/overview.md) 来管理一个或多个 eKuiper 实例。
+LF Edge eKuiper 是轻量级物联网数据分析和流处理软件,通常在边缘端运行。 它提供了一个 [管理仪表板](../../operation/manager-ui/overview.md) 来管理一个或多个 eKuiper 实例。
 通常,仪表板部署在云节点中,用于管理跨多个边缘节点的 eKuiper 实例。
 
 在大多数情况下,出于安全或其他考虑,边缘节点在物理上无法从云节点访问。 这使得部署变得困难,并且无法进行云到边缘管理。 [OpenYurt](https://github.com/openyurtio/openyurt) 改变了这种情况。
@@ -284,7 +284,7 @@ kubectl apply -f config/setup/yurt-tunnel-agent.yaml
 
 ![system](./ping.png)
 
-很棒! 现在我们可以通过仪表板在边缘管理 eKuiper,就像它部署在云端一样。参照 [manager ui教程](../operation/manager-ui/overview.md),可以从云端创建和管理 eKuiper
+很棒! 现在我们可以通过仪表板在边缘管理 eKuiper,就像它部署在云端一样。参照 [manager ui教程](../../operation/manager-ui/overview.md),可以从云端创建和管理 eKuiper
 的流、规则和插件以及任何类似的管理工作。
 
 ## 扩展阅读
@@ -294,4 +294,4 @@ kubectl apply -f config/setup/yurt-tunnel-agent.yaml
 - [eKuiper Github 代码库](https://github.com/lf-edge/ekuiper/)
 - [eKuiper 参考指南](https://github.com/lf-edge/ekuiper/blob/edgex/docs/en_US/reference.md)
 - [OpenYurt 教程](https://github.com/openyurtio/openyurt/tree/master/docs/tutorial)
-- [eKuiper 管理控制台教程](../operation/manager-ui/overview.md)
+- [eKuiper 管理控制台教程](../../operation/manager-ui/overview.md)

docs/zh_CN/deploy/ping.png → docs/zh_CN/tutorials/deploy/ping.png