This is an automated email from the ASF dual-hosted git repository.

laurence pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new f277c1ca delete route sample (#322)
f277c1ca is described below

commit f277c1cafb2ea2a5d84af6de6effb9567c8d6d48
Author: pherzheyu <[email protected]>
AuthorDate: Thu May 5 11:12:34 2022 +0800

    delete route sample (#322)
    
    * delete route sample
    
    * chmod +x start_integrate_test.sh
---
 .run/route/meshroute/meshroute-go-client.run.xml   |  14 ---
 .run/route/meshroute/meshroute-go-server.run.xml   |  14 ---
 .../tests/integration/greetprovider_test.go        |  94 -------------------
 .../route/meshroute/tests/integration/main_test.go |  46 ----------
 route/meshroute/README.md                          |   9 --
 route/meshroute/README_zh.md                       |   9 --
 route/meshroute/go-client/cmd/client.go            | 101 ---------------------
 route/meshroute/go-client/conf/dubbogo.yml         |  17 ----
 route/meshroute/go-client/conf/mesh_route.yml      |  39 --------
 route/meshroute/go-server/cmd/server.go            |  50 ----------
 route/meshroute/go-server/conf/dubbogo.yml         |  22 -----
 start_integrate_test.sh                            |   3 -
 12 files changed, 418 deletions(-)

diff --git a/.run/route/meshroute/meshroute-go-client.run.xml 
b/.run/route/meshroute/meshroute-go-client.run.xml
deleted file mode 100644
index 06629f68..00000000
--- a/.run/route/meshroute/meshroute-go-client.run.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="meshroute-go-client" 
type="GoApplicationRunConfiguration" factoryName="Go Application" 
folderName="router">
-    <module name="dubbo-go-samples" />
-    <working_directory value="$PROJECT_DIR$" />
-    <envs>
-      <env name="DUBBO_GO_CONFIG_PATH" 
value="$PROJECT_DIR$/route/meshroute/go-client/conf/dubbogo.yml" />
-    </envs>
-    <kind value="PACKAGE" />
-    <package 
value="github.com/apache/dubbo-go-samples/route/meshroute/go-client/cmd" />
-    <directory value="$PROJECT_DIR$/../dubbo-go" />
-    <filePath value="$PROJECT_DIR$/route/meshroute/go-client/cmd/client.go" />
-    <method v="2" />
-  </configuration>
-</component>
\ No newline at end of file
diff --git a/.run/route/meshroute/meshroute-go-server.run.xml 
b/.run/route/meshroute/meshroute-go-server.run.xml
deleted file mode 100644
index 48c2cc84..00000000
--- a/.run/route/meshroute/meshroute-go-server.run.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="meshroute-go-server" 
type="GoApplicationRunConfiguration" factoryName="Go Application" 
folderName="router">
-    <module name="dubbo-go-samples" />
-    <working_directory value="$PROJECT_DIR$" />
-    <envs>
-      <env name="DUBBO_GO_CONFIG_PATH" 
value="$PROJECT_DIR$/route/meshroute/go-server/conf/dubbogo.yml" />
-    </envs>
-    <kind value="PACKAGE" />
-    <package 
value="github.com/apache/dubbo-go-samples/route/meshroute/go-server/cmd" />
-    <directory value="$PROJECT_DIR$/../dubbo-go" />
-    <filePath value="$PROJECT_DIR$/route/meshroute/go-server/cmd/server.go" />
-    <method v="2" />
-  </configuration>
-</component>
\ No newline at end of file
diff --git 
a/integrate_test/route/meshroute/tests/integration/greetprovider_test.go 
b/integrate_test/route/meshroute/tests/integration/greetprovider_test.go
deleted file mode 100644
index 7ae1671a..00000000
--- a/integrate_test/route/meshroute/tests/integration/greetprovider_test.go
+++ /dev/null
@@ -1,94 +0,0 @@
-// +build integration
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package integration
-
-import (
-       "context"
-       "testing"
-)
-
-import (
-       _ "dubbo.apache.org/dubbo-go/v3/common/logger"
-       "dubbo.apache.org/dubbo-go/v3/config"
-       _ "dubbo.apache.org/dubbo-go/v3/imports"
-
-       "github.com/stretchr/testify/assert"
-)
-
-import (
-       api "github.com/apache/dubbo-go-samples/api"
-)
-
-const MeshRouteConf = "apiVersion: service.dubbo.apache.org/v1alpha1\n" +
-       "kind: DestinationRule\n" +
-       "metadata: { name: demo-route }\n" +
-       "spec:\n" +
-       "  host: demo\n" +
-       "  subsets:\n" +
-       "    - labels: { env-sign: xxx, tag1: hello }\n" +
-       "      name: isolation\n" +
-       "    - labels: { env-sign: yyy }\n" +
-       "      name: testing-trunk\n" +
-       "    - labels: { env-sign: zzz }\n" +
-       "      name: testing\n" +
-       "  trafficPolicy:\n" +
-       "    loadBalancer: { simple: ROUND_ROBIN }\n\n" +
-       "---\n\n" +
-       "apiVersion: service.dubbo.apache.org/v1alpha1\n" +
-       "kind: VirtualService\n" +
-       "metadata: {name: demo-route}\n" +
-       "spec:\n" +
-       "  dubbo:\n" +
-       "    - routedetail:\n" +
-       "        - match:\n" +
-       "            - sourceLabels: {trafficLabel: xxx}\n" +
-       "          name: xxx-project\n" +
-       "          route:\n" +
-       "            - destination: {host: demo, subset: isolation}\n" +
-       "        - match:\n" +
-       "            - sourceLabels: {trafficLabel: testing-trunk}\n" +
-       "          name: testing-trunk\n" +
-       "          route:\n" +
-       "            - destination: {host: demo, subset: testing-trunk}\n" +
-       "        - name: testing\n" +
-       "          route:\n" +
-       "            - destination: {host: demo, subset: testing}\n" +
-       "      services:\n" +
-       "        - {exact: com.apache.dubbo.sample.basic.IGreeter}\n" +
-       "  hosts: [demo]"
-
-func TestGetUser(t *testing.T) {
-       config.GetRootConfig().ConfigCenter = 
config.NewConfigCenterConfigBuilder().SetProtocol("zookeeper").SetAddress("127.0.0.1:2181").SetDataID("dubbo-go-samples-configcenter-zookeeper-client").Build()
-       dynamicConfiguration, err := 
config.GetRootConfig().ConfigCenter.GetDynamicConfiguration()
-       assert.Nil(t, err)
-       // 1. publish mesh route config
-       err = dynamicConfiguration.PublishConfig("dubbo.io.MESHAPPRULE", 
"dubbo", MeshRouteConf)
-       assert.Nil(t, err)
-
-       req := &api.HelloRequest{
-               Name: "Dong",
-       }
-       reply, err := grpcGreeterImpl.SayHello(context.Background(), req)
-       assert.Nil(t, err)
-
-       assert.Equal(t, "Hello Dong", reply.Name)
-       assert.Equal(t, "12345", reply.Id)
-       assert.Equal(t, int32(21), reply.Age)
-}
diff --git a/integrate_test/route/meshroute/tests/integration/main_test.go 
b/integrate_test/route/meshroute/tests/integration/main_test.go
deleted file mode 100644
index a6e844d7..00000000
--- a/integrate_test/route/meshroute/tests/integration/main_test.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build integration
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package integration
-
-import (
-       "os"
-       "testing"
-)
-
-import (
-       _ "dubbo.apache.org/dubbo-go/v3/common/logger"
-       "dubbo.apache.org/dubbo-go/v3/config"
-       _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
-       api "github.com/apache/dubbo-go-samples/api"
-)
-
-var (
-       grpcGreeterImpl = &api.GreeterClientImpl{}
-)
-
-func TestMain(m *testing.M) {
-       config.SetConsumerService(grpcGreeterImpl)
-       config.Load()
-
-       os.Exit(m.Run())
-}
diff --git a/route/meshroute/README.md b/route/meshroute/README.md
deleted file mode 100644
index ea800c91..00000000
--- a/route/meshroute/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Mesh Route for Dubbo-go 3.0
-
-For api definition and go client and server startup, please refer to [dubbo-go 
3.0 
quickstart](https://dubbogo.github.io/zh-cn/docs/user/quickstart/3.0/quickstart.html)
-
-## Instructions
-1. Start `zookeeper` service by docker with 
`integrate_test/dockercompose/docker-compose.yml` or executable binary file.
-2. Start the server service.
-3. Get dynamic configuration and publish mesh route config.
-4. Use the client to call the server-side service.
\ No newline at end of file
diff --git a/route/meshroute/README_zh.md b/route/meshroute/README_zh.md
deleted file mode 100644
index c0f42e23..00000000
--- a/route/meshroute/README_zh.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Helloworld for Dubbo-go 3.0
-
-api 定义以及 go 客户端、服务端启动,可以参考 [dubbo-go 3.0 
快速开始](https://dubbogo.github.io/zh-cn/docs/user/quickstart/3.0/quickstart.html)
-
-## 使用方法
-1. 可以使用 docker 结合 `integrate_test/dockercompose/docker-compose.yml` 
文件或下载官网的二进制文件启动 zookeeper 服务。
-2. 启动服务端服务。
-3. 获取动态配置中心,并发布 mesh 路由配置。
-4. 使用客户端调用服务端发布的服务。
\ No newline at end of file
diff --git a/route/meshroute/go-client/cmd/client.go 
b/route/meshroute/go-client/cmd/client.go
deleted file mode 100644
index f1fcf15b..00000000
--- a/route/meshroute/go-client/cmd/client.go
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package main
-
-import (
-       "context"
-)
-
-import (
-       "dubbo.apache.org/dubbo-go/v3/common/logger"
-       "dubbo.apache.org/dubbo-go/v3/config"
-       _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
-       "github.com/apache/dubbo-go-samples/api"
-)
-
-const MeshRouteConf = "apiVersion: service.dubbo.apache.org/v1alpha1\n" +
-       "kind: DestinationRule\n" +
-       "metadata: { name: demo-route }\n" +
-       "spec:\n" +
-       "  host: demo\n" +
-       "  subsets:\n" +
-       "    - labels: { env-sign: xxx, tag1: hello }\n" +
-       "      name: isolation\n" +
-       "    - labels: { env-sign: yyy }\n" +
-       "      name: testing-trunk\n" +
-       "    - labels: { env-sign: zzz }\n" +
-       "      name: testing\n" +
-       "  trafficPolicy:\n" +
-       "    loadBalancer: { simple: ROUND_ROBIN }\n\n" +
-       "---\n\n" +
-       "apiVersion: service.dubbo.apache.org/v1alpha1\n" +
-       "kind: VirtualService\n" +
-       "metadata: {name: demo-route}\n" +
-       "spec:\n" +
-       "  dubbo:\n" +
-       "    - routedetail:\n" +
-       "        - match:\n" +
-       "            - sourceLabels: {trafficLabel: xxx}\n" +
-       "          name: xxx-project\n" +
-       "          route:\n" +
-       "            - destination: {host: demo, subset: isolation}\n" +
-       "        - match:\n" +
-       "            - sourceLabels: {trafficLabel: testing-trunk}\n" +
-       "          name: testing-trunk\n" +
-       "          route:\n" +
-       "            - destination: {host: demo, subset: testing-trunk}\n" +
-       "        - name: testing\n" +
-       "          route:\n" +
-       "            - destination: {host: demo, subset: testing}\n" +
-       "      services:\n" +
-       "        - {exact: com.apache.dubbo.sample.basic.IGreeter}\n" +
-       "  hosts: [demo]"
-
-var grpcGreeterImpl = &api.GreeterClientImpl{}
-
-// export DUBBO_GO_CONFIG_PATH= 
PATH_TO_SAMPLES/route/meshroute/go-client/conf/dubbogo.yml
-func main() {
-       config.SetConsumerService(grpcGreeterImpl)
-       if err := config.Load(); err != nil {
-               panic(err)
-       }
-
-       dynamicConfiguration, err := 
config.GetRootConfig().ConfigCenter.GetDynamicConfiguration()
-       if err != nil {
-               panic(err)
-       }
-
-       // publish mesh route config
-       err = dynamicConfiguration.PublishConfig("dubbo.io.MESHAPPRULE", 
"dubbo", MeshRouteConf)
-       if err != nil {
-               return
-       }
-
-       logger.Info("start to test dubbo")
-       req := &api.HelloRequest{
-               Name: "Dong",
-       }
-       reply, err := grpcGreeterImpl.SayHello(context.Background(), req)
-       if err != nil {
-               logger.Error(err)
-       }
-       logger.Infof("client response result: %v\n", reply)
-}
diff --git a/route/meshroute/go-client/conf/dubbogo.yml 
b/route/meshroute/go-client/conf/dubbogo.yml
deleted file mode 100644
index 91324f5c..00000000
--- a/route/meshroute/go-client/conf/dubbogo.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-dubbo:
-  registries:
-    demoZK:
-      protocol: zookeeper
-      timeout: 3s
-      address: 127.0.0.1:2181
-  consumer:
-    registry-ids:
-      - demoZK
-    references:
-      GreeterClientImpl:
-        protocol: tri
-        interface: com.apache.dubbo.sample.basic.IGreeter # must be compatible 
with grpc or dubbo-java
-  config-center:
-    protocol: zookeeper
-    address: 127.0.0.1:2181
-    data-id: "dubbo-go-samples-configcenter-zookeeper-client"
\ No newline at end of file
diff --git a/route/meshroute/go-client/conf/mesh_route.yml 
b/route/meshroute/go-client/conf/mesh_route.yml
deleted file mode 100644
index 76af336c..00000000
--- a/route/meshroute/go-client/conf/mesh_route.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-apiVersion: service.dubbo.apache.org/v1alpha1
-kind: DestinationRule
-metadata: { name: demo-route }
-spec:
-  host: demo
-  subsets:
-    - labels: { env-sign: xxx, tag1: hello }
-      name: isolation
-    - labels: { env-sign: yyy }
-      name: testing-trunk
-    - labels: { env-sign: zzz }
-      name: testing
-  trafficPolicy:
-    loadBalancer: { simple: ROUND_ROBIN }
-
----
-
-apiVersion: service.dubbo.apache.org/v1alpha1
-kind: VirtualService
-metadata: {name: demo-route}
-spec:
-  dubbo:
-    - routedetail:
-        - match:
-            - sourceLabels: {trafficLabel: xxx}
-          name: xxx-project
-          route:
-            - destination: {host: demo, subset: isolation}
-        - match:
-            - sourceLabels: {trafficLabel: testing-trunk}
-          name: testing-trunk
-          route:
-            - destination: {host: demo, subset: testing-trunk}
-        - name: testing
-          route:
-            - destination: {host: demo, subset: testing}
-      services:
-        - {exact: com.apache.dubbo.sample.basic.IGreeter}
-  hosts: [demo]
diff --git a/route/meshroute/go-server/cmd/server.go 
b/route/meshroute/go-server/cmd/server.go
deleted file mode 100644
index ba2e7ca8..00000000
--- a/route/meshroute/go-server/cmd/server.go
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package main
-
-import (
-       "context"
-)
-
-import (
-       "dubbo.apache.org/dubbo-go/v3/common/logger"
-       "dubbo.apache.org/dubbo-go/v3/config"
-       _ "dubbo.apache.org/dubbo-go/v3/imports"
-)
-
-import (
-       "github.com/apache/dubbo-go-samples/api"
-)
-
-type GreeterProvider struct {
-       api.UnimplementedGreeterServer
-}
-
-func (s *GreeterProvider) SayHello(ctx context.Context, in *api.HelloRequest) 
(*api.User, error) {
-       logger.Infof("Dubbo3 GreeterProvider get user name = %s\n", in.Name)
-       return &api.User{Name: "Hello " + in.Name, Id: "12345", Age: 21}, nil
-}
-
-// export DUBBO_GO_CONFIG_PATH= 
PATH_TO_SAMPLES/route/meshroute/go-server/conf/dubbogo.yml
-func main() {
-       config.SetProviderService(&GreeterProvider{})
-       if err := config.Load(); err != nil {
-               panic(err)
-       }
-       select {}
-}
diff --git a/route/meshroute/go-server/conf/dubbogo.yml 
b/route/meshroute/go-server/conf/dubbogo.yml
deleted file mode 100644
index 089df975..00000000
--- a/route/meshroute/go-server/conf/dubbogo.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-dubbo:
-  registries:
-    demoZK:
-      protocol: zookeeper
-      timeout: 3s
-      address: 127.0.0.1:2181
-  protocols:
-    triple:
-      name: tri
-      port: 20000
-  provider:
-    registry-ids:
-      - demoZK
-    services:
-      GreeterProvider:
-        interface: com.apache.dubbo.sample.basic.IGreeter # must be compatible 
with grpc or dubbo-java
-        params:
-          env-sign: zzz
-  config-center:
-    protocol: zookeeper
-    address: 127.0.0.1:2181
-    data-id: dubbo-go-samples-configcenter-zookeeper-client
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index c022c6cc..9d101aaa 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -24,9 +24,6 @@ array=("config-api/rpc/triple")
 array+=("config-api/configcenter/nacos")
 array+=("config-api/configcenter/zookeeper")
 
-# route
-array+=("route/meshroute")
-
 # error
 array+=("error/triple/hessian2")
 array+=("error/triple/pb")

Reply via email to