Browse Source

refactor(doc): update doc after structure change

Signed-off-by: ngjaying <ngjaying@gmail.com>
ngjaying 3 years ago
parent
commit
fe3fade10f

+ 1 - 1
README-CN.md

@@ -87,7 +87,7 @@ eKuiper 可以运行在各类物联网的边缘使用场景中,比如工业物
 
 ### EdgeX 吞吐量测试
 
-- 一个 [Go 应用](fvt_scripts/edgex/benchmark/pub.go) 用于向 ZeroMQ 消息总线发送数据,数据如下。
+- 一个 [Go 应用](test/edgex/benchmark/pub.go) 用于向 ZeroMQ 消息总线发送数据,数据如下。
 
   ```
   {

+ 1 - 1
README.md

@@ -79,7 +79,7 @@ Join our [Slack](https://join.slack.com/t/lfedge/shared_invite/zt-7kavdtmq-SeyFz
 
 ### EdgeX throughput test
 
-- A [Go application](fvt_scripts/edgex/benchmark/pub.go) is wrote to send data to ZeroMQ message bus, the data is as following.
+- A [Go application](test/edgex/benchmark/pub.go) is wrote to send data to ZeroMQ message bus, the data is as following.
 
   ```
   {

+ 1 - 1
docs/CONTRIBUTING.md

@@ -24,7 +24,7 @@ $ git commit -m "A brief summary of the commit
 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](../fvt_scripts/README.md) will be triggered with any PR submission, so please make sure that these testcases can be run successfully.
+- 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.
 
 ## Code conventions
 

+ 1 - 1
docs/en_US/README.md

@@ -70,7 +70,7 @@ Join our [Slack](https://join.slack.com/t/lfedge/shared_invite/zt-7kavdtmq-SeyFz
 
 ### EdgeX throughput test
 
-- A [Go application](https://github.com/lf-edge/ekuiper/tree/master/fvt_scripts/edgex/benchmark/pub.go) is wrote to send data to ZeroMQ message bus, the data is as following.
+- A [Go application](https://github.com/lf-edge/ekuiper/tree/master/test/edgex/benchmark/pub.go) is wrote to send data to ZeroMQ message bus, the data is as following.
 
   ```
   {

+ 4 - 4
docs/en_US/extension/function.md

@@ -6,11 +6,11 @@ In the eKuiper SQL syntax, [many built-in functions](../sqls/built-in_functions.
 
 ### Develop a customized function
 
-To develop a function for eKuiper is to implement [api.Function](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) interface and export it as a golang plugin.
+To develop a function for eKuiper is to implement [api.Function](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) interface and export it as a golang plugin.
 
 Before starting the development, you must [setup the environment for golang plugin](overview.md#setup-the-plugin-developing-environment). 
 
-To develop a function, the _Validate_ method is firstly to be implemented. This method will be called during SQL validation. In this method, a slice of [xsql.Expr](https://github.com/lf-edge/ekuiper/blob/master/xsql/ast.go) is passed as the parameter that contains the arguments for this function in the runtime. The developer can do a validation against it to check the argument count and type etc. If validation is successful, return nil. Otherwise, return an error object.
+To develop a function, the _Validate_ method is firstly to be implemented. This method will be called during SQL validation. In this method, a slice of [xsql.Expr](https://github.com/lf-edge/ekuiper/blob/master/pkg/ast/expr.go) is passed as the parameter that contains the arguments for this function in the runtime. The developer can do a validation against it to check the argument count and type etc. If validation is successful, return nil. Otherwise, return an error object.
 
 ```go
 //The argument is a list of xsql.Expr
@@ -36,11 +36,11 @@ As the function itself is a plugin, it must be in the main package. Given the fu
 var MyFunction myFunction
 ```
 
-The [Echo Function](https://github.com/lf-edge/ekuiper/blob/master/plugins/functions/echo/echo.go) is a good example.
+The [Echo Function](https://github.com/lf-edge/ekuiper/blob/master/extensions/functions/echo/echo.go) is a good example.
 
 ### Export multiple functions
 
-In one plugin, developers can export multiple functions. Each function must implement [api.Function](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) as described at [Develop a customized function](#develop-a-customized-function) section. Make sure all functions are exported like:
+In one plugin, developers can export multiple functions. Each function must implement [api.Function](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) as described at [Develop a customized function](#develop-a-customized-function) section. Make sure all functions are exported like:
 
 ```go
 var(

+ 2 - 2
docs/en_US/extension/sink.md

@@ -6,7 +6,7 @@ Sink feed data from eKuiper into external systems. eKuiper has built-in sink sup
 
 ### Develop a sink
 
-To develop a sink for eKuiper is to implement [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) interface and export it as a golang plugin.
+To develop a sink for eKuiper is to implement [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) interface and export it as a golang plugin.
 
 Before starting the development, you must [setup the environment for golang plugin](overview.md#setup-the-plugin-developing-environment). 
 
@@ -43,7 +43,7 @@ func MySink() api.Sink {
 }
 ```
 
-The [Memory Sink](https://github.com/lf-edge/ekuiper/blob/master/plugins/sinks/memory/memory.go) is a good example.
+The [Memory Sink](https://github.com/lf-edge/ekuiper/blob/master/extensions/sinks/memory/memory.go) is a good example.
 
 ### Package the sink
 Build the implemented sink as a go plugin and make sure the output so file resides in the plugins/sinks folder.

+ 2 - 2
docs/en_US/extension/source.md

@@ -6,7 +6,7 @@ Sources feed data into eKuiper from other systems. eKuiper has built-in source s
 
 ### Develop a source
 
-To develop a source for eKuiper is to implement [api.Source](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) interface and export it as a golang plugin.
+To develop a source for eKuiper is to implement [api.Source](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) interface and export it as a golang plugin.
 
 Before starting the development, you must [setup the environment for golang plugin](overview.md#setup-the-plugin-developing-environment). 
 
@@ -38,7 +38,7 @@ function MySource() api.Source{
 }
 ```
 
-The [Randome Source](https://github.com/lf-edge/ekuiper/blob/master/plugins/sources/random/random.go) is a good example.
+The [Random Source](https://github.com/lf-edge/ekuiper/blob/master/extensions/sources/random/random.go) is a good example.
 
 ### Rewindable source
 If the [rule checkpoint](../rules/state_and_fault_tolerance.md#source-consideration) is enabled, the source requires to be rewindable. That means the source need to implement both ``api.Source`` and ``api.Rewindable`` interface. 

+ 2 - 2
docs/en_US/plugins/functions/tensorflow_lite_tutorial.md

@@ -17,7 +17,7 @@ To integrate eKuiper with TensorFlow lite, we will develop a customized eKuiper
 To develop the function plugin, we need to:
 
 1. Create the plugin go file.  For example, in eKuiper source code, create *plugins/functions/labelImage/labelImage.go* file.
-2. Create a struct that implements [api.Function interface](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go). 
+2. Create a struct that implements [api.Function interface](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go). 
 3. Export the struct.
 
 The key part of the implementation is the *Exec* function. The pseudo code is like:
@@ -53,7 +53,7 @@ var LabelImage = labelImage{
 }
 ```
 
-Check [this tutorial](../plugins_tutorial.md) for detail steps of creating eKuiper plugins.  Please refer to [labelImage.go](https://github.com/lf-edge/ekuiper/blob/master/plugins/functions/labelImage/labelImage.go) for the full source code.
+Check [this tutorial](../plugins_tutorial.md) for detail steps of creating eKuiper plugins.  Please refer to [labelImage.go](https://github.com/lf-edge/ekuiper/blob/master/extensions/functions/labelImage/labelImage.go) for the full source code.
 
 ## Build and install the plugin
 

+ 1 - 1
docs/en_US/plugins/plugins_tutorial.md

@@ -57,7 +57,7 @@ The eKuiper plugin has three types. The source code can be put into the correspo
 - Create plugin the project samplePlugin with the above directory structure
 - Create file mysql.go under the sinks directory
 - Edit file mysql.go for implementing the plugin
-    -  Implement [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) interface
+    -  Implement [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) interface
     - Export Symbol: Mysql. It could be a constructor function so that each rule can instantiate an own mysql plugin instance. Or it could be the struct which means every rule will share a singleton of the plugin. If the plugin has states like the connection, the first approach is preferred.
 - Edit go.mod, add Mysql driver module
 

+ 1 - 1
docs/zh_CN/README.md

@@ -70,7 +70,7 @@ eKuiper 可以运行在各类物联网的边缘使用场景中,比如工业物
 
 ### EdgeX 吞吐量测试
 
-- 一个 [Go 应用](https://github.com/lf-edge/ekuiper/blob/master/fvt_scripts/edgex/benchmark/pub.go) 用于向 ZeroMQ 消息总线发送数据,数据如下。
+- 一个 [Go 应用](https://github.com/lf-edge/ekuiper/blob/master/test/edgex/benchmark/pub.go) 用于向 ZeroMQ 消息总线发送数据,数据如下。
 
   ```
   {

+ 4 - 4
docs/zh_CN/extension/function.md

@@ -6,11 +6,11 @@
 
 ### 开发一个定制函数
 
-为 eKuiper 开发函数的过程,就是实现 [api.Function](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) 接口并将其导出为 golang 插件。
+为 eKuiper 开发函数的过程,就是实现 [api.Function](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) 接口并将其导出为 golang 插件。
 
 在开始开发之前,您必须为 [golang 插件设置环境](overview.md#setup-the-plugin-developing-environment)。
 
-为了开发函数,首先要实现 _Validate_ 方法。 在 SQL 验证期间将调用此方法。 在此方法中,将传递 [xsql.Expr](https://github.com/lf-edge/ekuiper/blob/master/xsql/ast.go) 的切片作为参数,该参数包含运行时该函数的参数。 开发人员可以对其进行验证,以检查参数计数和类型等。如果验证成功,则返回 nil。 否则,返回一个错误对象。
+为了开发函数,首先要实现 _Validate_ 方法。 在 SQL 验证期间将调用此方法。 在此方法中,将传递 [xsql.Expr](https://github.com/lf-edge/ekuiper/blob/master/pkg/ast/expr.go) 的切片作为参数,该参数包含运行时该函数的参数。 开发人员可以对其进行验证,以检查参数计数和类型等。如果验证成功,则返回 nil。 否则,返回一个错误对象。
 
 ```go
 //The argument is a list of xsql.Expr
@@ -36,11 +36,11 @@ Exec(args []interface{}) (interface{}, bool)
 var MyFunction myFunction
 ```
 
-[Echo Function](https://github.com/lf-edge/ekuiper/blob/master/plugins/functions/echo/echo.go) 是一个很好的示例。
+[Echo Function](https://github.com/lf-edge/ekuiper/blob/master/extensions/functions/echo/echo.go) 是一个很好的示例。
 
 ### 导出多个函数
 
-开发者可在一个函数插件中导出多个函数。每个函数均需实现 [api.Function](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) 接口,正如 [开发一个定制函数](#develop-a-customized-function) 所描述的那样。需要确保所有函数都导出了,如下所示:
+开发者可在一个函数插件中导出多个函数。每个函数均需实现 [api.Function](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) 接口,正如 [开发一个定制函数](#develop-a-customized-function) 所描述的那样。需要确保所有函数都导出了,如下所示:
 
 ```go
 var(

+ 2 - 2
docs/zh_CN/extension/sink.md

@@ -6,7 +6,7 @@ eKuiper 可以将数据接收到外部系统。 eKuiper具有对  [MQTT 消息
 
 ### 开发 Sink (目标)
 
-为 eKuiper 开发 Sink (目标),是实现 [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) 接口并将其导出为 golang 插件。
+为 eKuiper 开发 Sink (目标),是实现 [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) 接口并将其导出为 golang 插件。
 
 在开始开发之前,您必须为 [golang 插件设置环境](overview.md#setup-the-plugin-developing-environment)。
 
@@ -44,7 +44,7 @@ func MySink() api.Sink {
 }
 ```
 
-[Memory Sink](https://github.com/lf-edge/ekuiper/blob/master/plugins/sinks/memory/memory.go) 是一个很好的示例。
+[Memory Sink](https://github.com/lf-edge/ekuiper/blob/master/extensions/sinks/memory/memory.go) 是一个很好的示例。
 
 ### 将 Sink (目标)打包
 将实现的 Sink (目标)构建为 go 插件,并确保输出的 so 文件位于 plugins/sinks 文件夹中。

+ 2 - 2
docs/zh_CN/extension/source.md

@@ -6,7 +6,7 @@
 
 ### 开发一个源
 
-为 eKuiper 开发源的 是实现 [api.Source](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) 接口并将其导出为 golang 插件。
+为 eKuiper 开发源的 是实现 [api.Source](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) 接口并将其导出为 golang 插件。
 
 在开始开发之前,您必须为 [golang 插件设置环境](overview.md#setup-the-plugin-developing-environment)。
 
@@ -38,7 +38,7 @@ function MySource() api.Source{
 }
 ```
 
-[Randome Source](https://github.com/lf-edge/ekuiper/blob/master/plugins/sources/random/random.go)  是一个很好的示例。
+[Random Source](https://github.com/lf-edge/ekuiper/blob/master/extensions/sources/random/random.go)  是一个很好的示例。
 
 ### 处理配置
 

+ 2 - 2
docs/zh_CN/plugins/functions/tensorflow_lite_tutorial.md

@@ -17,7 +17,7 @@
 要开发函数插件,我们需要:
 
 1. 创建插件 go 文件。 例如,在 eKuiper 源代码中,创建 *plugins/functions/labelImage/labelImage.go* 文件。
-2. 创建一个实现 [api.函数接口](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go) 的 struct。
+2. 创建一个实现 [api.函数接口](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go) 的 struct。
 3. 导出 struct。
 
 实现的关键是 *Exec* 函数。 伪代码如下:
@@ -53,7 +53,7 @@ var LabelImage = labelImage{
 }
 ```
 
-查阅 [本教程](../plugins_tutorial.md) 以获得创建 eKuiper 插件的详细步骤。请参阅 [labelImage.go](https://github.com/lf-edge/ekuiper/blob/master/plugins/functions/labelImage/labelImage.go) 以获取完整的源代码。
+查阅 [本教程](../plugins_tutorial.md) 以获得创建 eKuiper 插件的详细步骤。请参阅 [labelImage.go](https://github.com/lf-edge/ekuiper/blob/master/extensions/functions/labelImage/labelImage.go) 以获取完整的源代码。
 
 ## 构建并安装插件
 

+ 1 - 1
docs/zh_CN/plugins/plugins_tutorial.md

@@ -57,7 +57,7 @@ eKuiper 插件有三种类型,源代码可放入对应的目录中。插件开
 - 新建名为 samplePlugin 的插件项目,采用上文的目录结构
 - 在 sinks 目录下,新建 mysql.go 文件
 - 编辑 mysql.go 文件以实现插件
-    -  实现 [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/xstream/api/stream.go)接口
+    -  实现 [api.Sink](https://github.com/lf-edge/ekuiper/blob/master/pkg/api/stream.go)接口
     - 导出 Symbol:Mysql。它既可以是一个“构造函数”,也可以是结构体本身。当导出构造函数时,使用该插件的规则初始化时会用此函数创建该插件的实例;当导出为结构体时,所有使用该插件的规则将公用该插件同一个单例。如果插件有状态,例如数据库连接,建议使用第一种方法。
 - 编辑 go.mod, 添加 mysql 驱动模块
 

+ 9 - 9
test/README.md

@@ -70,9 +70,9 @@ For most of scripts, you can just start JMeter by default way, such as ``bin/jme
   The script need to be told about the location of eKuiper install directory, so script knows where to invoke eKuiper CLI.
   
   - Specify the ``base`` property in the JMeter command line, the ``base`` is where eKuiper installs. 
-  - Specify the ``fvt`` property in the JMeter command line, the ``fvt`` is where you develop eKuiper, script will read rule file  ``fvt_scripts/rule1.txt`` from the location.
+  - Specify the ``fvt`` property in the JMeter command line, the ``fvt`` is where you develop eKuiper, script will read rule file  ``test/rule1.txt`` from the location.
   
-  - Modify ``mqtt.server`` to your MQTT broker address in file ``fvt_scripts/rule1.txt``.
+  - Modify ``mqtt.server`` to your MQTT broker address in file ``test/rule1.txt``.
   
   - So below is command for starting JMeter.
   
@@ -140,10 +140,10 @@ For most of scripts, you can just start JMeter by default way, such as ``bin/jme
   - An EdgeX message bus publish tool should be compiled and run during running test.
 
     ```shell
-    # go build -o fvt_scripts/edgex/pub fvt_scripts/edgex/pub.go
+    # go build -o test/edgex/pub test/edgex/pub.go
     ```
 
-  - Run the JMeter with following command, and specify the ``fvt`` property in the JMeter command line, the ``fvt`` is where you develop eKuiper, script will search ``fvt_scripts/edgex/pub`` from the location.
+  - Run the JMeter with following command, and specify the ``fvt`` property in the JMeter command line, the ``fvt`` is where you develop eKuiper, script will search ``test/edgex/pub`` from the location.
 
     ```shell
     bin/jmeter.sh -Dfvt="/Users/rockyjin/Downloads/workspace/edge/src/ekuiper"
@@ -153,7 +153,7 @@ For most of scripts, you can just start JMeter by default way, such as ``bin/jme
   
   - Another JMeter mock-up user subscribes MQTT result topic, and assert message number and contents.
   
-- [Multiple EdgeX source configurations](fvt_scripts/select_edgex_another_bus_rule.jmx)
+- [Multiple EdgeX source configurations](test/select_edgex_another_bus_rule.jmx)
 
   The test script is used for testing specifying another EdgeX source configurations in eKuiper.
 
@@ -182,7 +182,7 @@ For most of scripts, you can just start JMeter by default way, such as ``bin/jme
   As with the previous 2 testcases, besides to prepare ``pub`` application, another ``sub`` application should also be prepared.
 
   ```shell
-  # go build -o fvt_scripts/edgex/sub/sub fvt_scripts/edgex/sub/sub.go 
+  # go build -o test/edgex/sub/sub test/edgex/sub/sub.go 
   ```
 
 - [EdgeX array data type](edgex_array_rule.jmx)
@@ -194,13 +194,13 @@ For most of scripts, you can just start JMeter by default way, such as ``bin/jme
 - [An end to end plugin test](plugin_end_2_end.jmx)
   The script is an end-2-end plugin test. It requires a mock http server, and also a plugin.
     ```shell
-    # go build -o fvt_scripts/plugins/service/http_server fvt_scripts/plugins/service/server.go 
+    # go build -o test/plugins/service/http_server test/plugins/service/server.go 
     ```
 
 - [Pull HTTP test](http_pull_rule.jmx)
   
-  The test script verifies HTTP pull source. It sends request to a [server](fvt_scripts/plugins/service/server.go). The script set incremental to true, so it will compare with last result; If response of two requests are the same, then will skip sending out the result.
-  This script also requires to run [server](fvt_scripts/plugins/service/server.go), please refer to last testcase for how to compile and run.
+  The test script verifies HTTP pull source. It sends request to a [server](test/plugins/service/server.go). The script set incremental to true, so it will compare with last result; If response of two requests are the same, then will skip sending out the result.
+  This script also requires to run [server](test/plugins/service/server.go), please refer to last testcase for how to compile and run.
   
 - [Binary data type test](http_pull_rule.jmx)
   

+ 1 - 1
test/edgex/benchmark/README.md

@@ -2,7 +2,7 @@
 
 - Build the ``pub.go``, this is used for simulating the data.
     ```shell
-    # go build -o fvt_scripts/edgex/benchmark/pub fvt_scripts/edgex/benchmark/pub.go
+    # go build -o test/edgex/benchmark/pub test/edgex/benchmark/pub.go
     ```
 
 - Update edgex configuration. Update ``Server`` configuration to the address where you run ``pub`` in the 1st step.