Explorar o código

refactor(portable): rename go sdk module to match the path

Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Jiyong Huang %!s(int64=3) %!d(string=hai) anos
pai
achega
beb74e5540

+ 3 - 3
docs/en_US/extension/portable/go_sdk.md

@@ -8,7 +8,7 @@ By using GO SDK for portable plugins, user can develop portable plugins with go
 
 As the GO SDK provides almost identical API interfaces, the user's source, sink and function plugin can almost reuse by only some small modifications.
 
-To develop the portable plugin, users need to depend on `github.com/lf-edge/ekuiper/sdk` instead of eKuiper main project. Then to implement source, just implement the interfaces in package `github.com/lf-edge/ekuiper/sdk/api`.
+To develop the portable plugin, users need to depend on `github.com/lf-edge/ekuiper/sdk/go` instead of eKuiper main project. Then to implement source, just implement the interfaces in package `github.com/lf-edge/ekuiper/sdk/go/api`.
 
 For source, implement the source interface as below as the same as described in [native plugin source](../native/source.md).
 
@@ -58,8 +58,8 @@ As the portable plugin is a standalone program, it needs a main program to be ab
 package main
 
 import (
-	"github.com/lf-edge/ekuiper/sdk/api"
-	sdk "github.com/lf-edge/ekuiper/sdk/runtime"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	sdk "github.com/lf-edge/ekuiper/sdk/go/runtime"
 	"os"
 )
 

+ 3 - 3
docs/zh_CN/extension/portable/go_sdk.md

@@ -8,7 +8,7 @@
 
 由于 portable 插件 GO SDK 提供了类似原生插件的API,用户做简单的修改即可复用以前编写的原生插件
 
-用户只需依赖 `github.com/lf-edge/ekuiper/sdk` 而不是 eKuiper 主项目即可编写 portable 插件,用户需要实现 `github.com/lf-edge/ekuiper/sdk/api` 中的相应接口即可
+用户只需依赖 `github.com/lf-edge/ekuiper/sdk/go` 而不是 eKuiper 主项目即可编写 portable 插件,用户需要实现 `github.com/lf-edge/ekuiper/sdk/go/api` 中的相应接口即可
 
 对于源,实现跟[原生源插件](../native/source.md)中一样的接口即可 
 
@@ -57,8 +57,8 @@ type Function interface {
 package main
 
 import (
-	"github.com/lf-edge/ekuiper/sdk/api"
-	sdk "github.com/lf-edge/ekuiper/sdk/runtime"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	sdk "github.com/lf-edge/ekuiper/sdk/go/runtime"
 	"os"
 )
 

+ 2 - 2
sdk/go/connection/connection.go

@@ -16,8 +16,8 @@ package connection
 
 import (
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/context"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/context"
 	"go.nanomsg.org/mangos/v3"
 	"go.nanomsg.org/mangos/v3/protocol/pull"
 	"go.nanomsg.org/mangos/v3/protocol/push"

+ 1 - 1
sdk/go/context/default.go

@@ -16,7 +16,7 @@ package context
 
 import (
 	"context"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"github.com/sirupsen/logrus"
 	"time"
 )

+ 1 - 1
sdk/go/context/func_context.go

@@ -16,7 +16,7 @@ package context
 
 import (
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 )
 
 type DefaultFuncContext struct {

+ 1 - 1
sdk/go/context/logger.go

@@ -16,7 +16,7 @@ package context
 
 import (
 	filename "github.com/keepeye/logrus-filename"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"github.com/sirupsen/logrus"
 )
 

+ 1 - 1
sdk/go/example/mirror/echo_func.go

@@ -16,7 +16,7 @@ package main
 
 import (
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 )
 
 type echo struct {

+ 1 - 1
sdk/go/example/mirror/echo_func_test.go

@@ -15,7 +15,7 @@
 package main
 
 import (
-	"github.com/lf-edge/ekuiper/sdk/mock"
+	"github.com/lf-edge/ekuiper/sdk/go/mock"
 	"testing"
 )
 

+ 1 - 1
sdk/go/example/mirror/file_sink.go

@@ -18,7 +18,7 @@ import (
 	"bufio"
 	"context"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"os"
 	"sync"
 	"time"

+ 1 - 1
sdk/go/example/mirror/file_sink_test.go

@@ -16,7 +16,7 @@ package main
 
 import (
 	"bufio"
-	"github.com/lf-edge/ekuiper/sdk/mock"
+	"github.com/lf-edge/ekuiper/sdk/go/mock"
 	"os"
 	"reflect"
 	"testing"

+ 2 - 2
sdk/go/example/mirror/go.mod

@@ -1,10 +1,10 @@
 module github.com/lf-edge/ekuiper-plugin-mirror
 
 require (
-	github.com/lf-edge/ekuiper/sdk v0.0.0-20210916082120-031cd83a7fd8
+	github.com/lf-edge/ekuiper/sdk/go v0.0.0-20210916082120-031cd83a7fd8
 	github.com/mitchellh/mapstructure v1.4.1
 )
 
-replace github.com/lf-edge/ekuiper/sdk => ../../
+replace github.com/lf-edge/ekuiper/sdk/go => ../../
 
 go 1.16

+ 2 - 2
sdk/go/example/mirror/main.go

@@ -15,8 +15,8 @@
 package main
 
 import (
-	"github.com/lf-edge/ekuiper/sdk/api"
-	sdk "github.com/lf-edge/ekuiper/sdk/runtime"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	sdk "github.com/lf-edge/ekuiper/sdk/go/runtime"
 	"os"
 )
 

+ 1 - 1
sdk/go/example/mirror/random_source.go

@@ -18,7 +18,7 @@ import (
 	"bytes"
 	"encoding/json"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"github.com/mitchellh/mapstructure"
 	"math/rand"
 	"strings"

+ 2 - 2
sdk/go/example/mirror/random_source_test.go

@@ -16,8 +16,8 @@ package main
 
 import (
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/mock"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/mock"
 	"reflect"
 	"testing"
 )

+ 1 - 1
sdk/go/go.mod

@@ -1,4 +1,4 @@
-module github.com/lf-edge/ekuiper/sdk
+module github.com/lf-edge/ekuiper/sdk/go
 
 go 1.16
 

+ 1 - 1
sdk/go/mock/mock.go

@@ -17,7 +17,7 @@ package mock
 import (
 	"context"
 	filename "github.com/keepeye/logrus-filename"
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"github.com/sirupsen/logrus"
 	"time"
 )

+ 1 - 1
sdk/go/mock/test_func.go

@@ -15,7 +15,7 @@
 package mock
 
 import (
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"reflect"
 	"testing"
 )

+ 1 - 1
sdk/go/mock/test_sink.go

@@ -14,7 +14,7 @@
 
 package mock
 
-import "github.com/lf-edge/ekuiper/sdk/api"
+import "github.com/lf-edge/ekuiper/sdk/go/api"
 
 func RunSinkCollect(s api.Sink, exp []string) error {
 	ctx := newMockContext("rule1", "op1")

+ 1 - 1
sdk/go/mock/test_source.go

@@ -15,7 +15,7 @@
 package mock
 
 import (
-	"github.com/lf-edge/ekuiper/sdk/api"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
 	"reflect"
 	"testing"
 	"time"

+ 3 - 3
sdk/go/runtime/function.go

@@ -18,9 +18,9 @@ import (
 	context2 "context"
 	"encoding/json"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/connection"
-	"github.com/lf-edge/ekuiper/sdk/context"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/connection"
+	"github.com/lf-edge/ekuiper/sdk/go/context"
 	"sync"
 )
 

+ 3 - 3
sdk/go/runtime/plugin.go

@@ -19,9 +19,9 @@ package runtime
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/connection"
-	"github.com/lf-edge/ekuiper/sdk/context"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/connection"
+	"github.com/lf-edge/ekuiper/sdk/go/context"
 	"go.nanomsg.org/mangos/v3"
 	"os"
 	"os/signal"

+ 2 - 2
sdk/go/runtime/sink.go

@@ -17,8 +17,8 @@ package runtime
 import (
 	context2 "context"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/connection"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/connection"
 )
 
 type sinkRuntime struct {

+ 2 - 2
sdk/go/runtime/source.go

@@ -17,8 +17,8 @@ package runtime
 import (
 	context2 "context"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/connection"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/connection"
 )
 
 // lifecycle controlled by plugin

+ 3 - 3
sdk/go/runtime/symbol.go

@@ -19,9 +19,9 @@ package runtime
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/lf-edge/ekuiper/sdk/api"
-	"github.com/lf-edge/ekuiper/sdk/connection"
-	"github.com/lf-edge/ekuiper/sdk/context"
+	"github.com/lf-edge/ekuiper/sdk/go/api"
+	"github.com/lf-edge/ekuiper/sdk/go/connection"
+	"github.com/lf-edge/ekuiper/sdk/go/context"
 )
 
 type RuntimeInstance interface {