You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/09/08 03:35:52 UTC
[dubbo-go-samples] branch config-enhance updated: fix: add grpc
(#231)
This is an automated email from the ASF dual-hosted git repository.
laurence pushed a commit to branch config-enhance
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
The following commit(s) were added to refs/heads/config-enhance by this push:
new 9a45888 fix: add grpc (#231)
9a45888 is described below
commit 9a45888245c443d7629034ce96609e75496de3a3
Author: Laurence <45...@users.noreply.github.com>
AuthorDate: Wed Sep 8 11:35:47 2021 +0800
fix: add grpc (#231)
---
go.mod | 2 +-
go.sum | 4 +
integrate_test.sh | 6 +-
.../configcenter/nacos/docker/docker-compose.yml | 19 -
.../nacos/docker/docker-health-check.sh | 14 -
.../nacos/tests/integration/main_test.go | 1 -
.../zookeeper/docker/docker-compose.yml | 19 -
.../zookeeper/tests/integration/main_test.go | 1 -
.../rpc/triple/docker/docker-compose.yml | 9 -
.../configcenter/apollo/docker/docker-compose.yml | 40 --
.../apollo/docker/docker-health-check.sh | 10 -
.../apollo/docker/sql/apolloconfigdb.sql | 433 -------------------
.../apollo/docker/sql/apolloportaldb.sql | 368 ----------------
integrate_test/configcenter/nacos/conf/client.yml | 64 ---
integrate_test/configcenter/nacos/conf/log.yml | 28 --
integrate_test/configcenter/nacos/conf/server.yml | 60 ---
.../configcenter/nacos/docker/docker-compose.yml | 20 -
.../nacos/docker/docker-health-check.sh | 3 -
integrate_test/context/dubbo/conf/client.yml | 59 ---
integrate_test/context/dubbo/conf/log.yml | 27 --
integrate_test/context/dubbo/conf/server.yml | 55 ---
integrate_test/direct/docker/docker-compose.yml | 9 -
.../direct/docker/docker-health-check.sh | 10 -
.../docker-health-check.sh | 7 +-
.../helloworld/docker/docker-compose.yml | 9 -
.../helloworld/docker/docker-health-check.sh | 10 -
.../registry/nacos/docker/docker-compose.yml | 14 -
.../registry/nacos/docker/docker-health-check.sh | 4 -
.../registry/zookeeper/docker/docker-compose.yml | 9 -
.../zookeeper/docker/docker-health-check.sh | 10 -
integrate_test/rpc/dubbo/docker/docker-compose.yml | 9 -
.../rpc/dubbo/docker/docker-health-check.sh | 10 -
.../rpc/grpc}/tests/integration/greeter_test.go | 9 +-
.../rpc/grpc/tests/integration/main_test.go | 27 +-
.../codec-extension/docker/docker-compose.yml | 9 -
.../codec-extension/docker/docker-health-check.sh | 10 -
.../rpc/triple/hessian2/docker/docker-compose.yml | 9 -
.../triple/hessian2/docker/docker-health-check.sh | 10 -
.../pb/dubbogo-grpc/docker/docker-compose.yml | 9 -
.../pb/dubbogo-grpc/docker/docker-health-check.sh | 10 -
rpc/grpc/go-client/cmd/client.go | 15 +-
rpc/grpc/go-client/conf/client.yml | 59 ---
rpc/grpc/go-client/conf/dubbogo.yml | 15 +
rpc/grpc/go-client/conf/log.yml | 27 --
rpc/grpc/go-server/cmd/server.go | 28 +-
rpc/grpc/go-server/conf/client.yml | 59 ---
rpc/grpc/go-server/conf/dubbogo.yml | 19 +
rpc/grpc/go-server/conf/log.yml | 27 --
rpc/grpc/go-server/conf/server.yml | 55 ---
rpc/grpc/go-server/docker/docker-compose.yml | 15 -
rpc/grpc/go-server/docker/docker-health-check.sh | 10 -
rpc/grpc/go-server/pkg/greeter.go | 42 --
rpc/grpc/go-server/tests/integration/main_test.go | 52 ---
rpc/grpc/protobuf/helloworld.pb.go | 34 +-
rpc/grpc/stream/go-client/app/Makefile | 2 -
rpc/grpc/stream/go-client/app/client.go | 148 -------
rpc/grpc/stream/go-client/app/helloworld.pb.go | 477 ---------------------
rpc/grpc/stream/go-client/app/helloworld.proto | 39 --
rpc/grpc/stream/go-client/assembly/bin/load.sh | 203 ---------
.../go-client/assembly/common/app.properties | 23 -
rpc/grpc/stream/go-client/assembly/common/build.sh | 83 ----
rpc/grpc/stream/go-client/assembly/linux/dev.sh | 36 --
.../stream/go-client/assembly/linux/release.sh | 35 --
rpc/grpc/stream/go-client/assembly/linux/test.sh | 35 --
rpc/grpc/stream/go-client/assembly/mac/dev.sh | 36 --
rpc/grpc/stream/go-client/assembly/mac/release.sh | 34 --
rpc/grpc/stream/go-client/assembly/mac/test.sh | 34 --
rpc/grpc/stream/go-client/assembly/windows/dev.sh | 34 --
.../stream/go-client/assembly/windows/release.sh | 34 --
rpc/grpc/stream/go-client/assembly/windows/test.sh | 34 --
rpc/grpc/stream/go-client/profiles/dev/client.yml | 61 ---
rpc/grpc/stream/go-client/profiles/dev/log.yml | 28 --
rpc/grpc/stream/go-client/profiles/release/log.yml | 28 --
rpc/grpc/stream/go-client/profiles/test/client.yml | 63 ---
rpc/grpc/stream/go-client/profiles/test/log.yml | 28 --
rpc/grpc/stream/go-server/app/greeter.go | 99 -----
rpc/grpc/stream/go-server/app/helloworld.pb.go | 477 ---------------------
rpc/grpc/stream/go-server/app/helloworld.proto | 39 --
rpc/grpc/stream/go-server/app/server.go | 71 ---
rpc/grpc/stream/go-server/app/version.go | 22 -
rpc/grpc/stream/go-server/assembly/bin/load.sh | 151 -------
.../go-server/assembly/common/app.properties | 23 -
rpc/grpc/stream/go-server/assembly/common/build.sh | 80 ----
rpc/grpc/stream/go-server/assembly/linux/dev.sh | 36 --
.../stream/go-server/assembly/linux/release.sh | 36 --
rpc/grpc/stream/go-server/assembly/linux/test.sh | 36 --
rpc/grpc/stream/go-server/assembly/mac/dev.sh | 36 --
rpc/grpc/stream/go-server/assembly/mac/release.sh | 36 --
rpc/grpc/stream/go-server/assembly/mac/test.sh | 36 --
rpc/grpc/stream/go-server/assembly/windows/dev.sh | 36 --
.../stream/go-server/assembly/windows/release.sh | 36 --
rpc/grpc/stream/go-server/assembly/windows/test.sh | 36 --
rpc/grpc/stream/go-server/profiles/dev/log.yml | 28 --
rpc/grpc/stream/go-server/profiles/dev/server.yml | 57 ---
rpc/grpc/stream/go-server/profiles/release/log.yml | 28 --
.../stream/go-server/profiles/release/server.yml | 54 ---
rpc/grpc/stream/go-server/profiles/test/log.yml | 28 --
rpc/grpc/stream/go-server/profiles/test/server.yml | 55 ---
start_integrate_test.sh | 13 +-
99 files changed, 122 insertions(+), 4815 deletions(-)
diff --git a/go.mod b/go.mod
index a3f7694..4e628ba 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,7 @@
module github.com/apache/dubbo-go-samples
require (
- dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210905041349-a1e4548f1e68
+ dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210908031551-f556336c4ba6
github.com/alibaba/sentinel-golang v1.0.2
github.com/apache/dubbo-getty v1.4.5
github.com/apache/dubbo-go-hessian2 v1.9.2
diff --git a/go.sum b/go.sum
index 8d960ad..ccb45ac 100644
--- a/go.sum
+++ b/go.sum
@@ -25,8 +25,12 @@ dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210902110215-82e825c9c36a h1:MQe72C0
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210902110215-82e825c9c36a/go.mod h1:truc+fGVX3f/luIG6lAc8D49JXETiRtWDF5CVkG7ZMY=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210904062533-3e0412eab250 h1:/OcfAvqXX0MAeylJnI+zeGYlG5icXrnxKjNvil6jjEA=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210904062533-3e0412eab250/go.mod h1:qzYPQolHmB+cfNhO0fUGTCWbBRdEnvyssdF8zNIiPLQ=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210904132732-90348d8238cd h1:JIlfgXOYZ5PAUKgpW/iUpvSvHzwL+9iVYHCnEGu57Ws=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210904132732-90348d8238cd/go.mod h1:qzYPQolHmB+cfNhO0fUGTCWbBRdEnvyssdF8zNIiPLQ=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210905041349-a1e4548f1e68 h1:Pu34qKSc+NxCOTA2pDMPdRDuuUmfI2Hr2rpxMpuPsvE=
dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210905041349-a1e4548f1e68/go.mod h1:qzYPQolHmB+cfNhO0fUGTCWbBRdEnvyssdF8zNIiPLQ=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210908031551-f556336c4ba6 h1:MBTQ7ewBVgG3ey+w9JQRk26Adp2oD4fDl5lTk6oseFI=
+dubbo.apache.org/dubbo-go/v3 v3.0.0-rc2.0.20210908031551-f556336c4ba6/go.mod h1:qzYPQolHmB+cfNhO0fUGTCWbBRdEnvyssdF8zNIiPLQ=
github.com/Azure/azure-sdk-for-go v40.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
diff --git a/integrate_test.sh b/integrate_test.sh
index ff2747c..89da2a4 100755
--- a/integrate_test.sh
+++ b/integrate_test.sh
@@ -28,11 +28,13 @@ fi
INTEGRATE_DIR=$(pwd)/integrate_test/$1
-# check docker health
-make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile docker-health-check
+# waiting for port release
+sleep 5
# start server
make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile start
+# waiting for registry
+sleep 5
# start integration
make PROJECT_DIR="$P_DIR" PROJECT_NAME="$(basename "$P_DIR")" INTEGRATE_DIR="$INTEGRATE_DIR" -f build/Makefile integration
diff --git a/integrate_test/config-api/configcenter/nacos/docker/docker-compose.yml b/integrate_test/config-api/configcenter/nacos/docker/docker-compose.yml
deleted file mode 100644
index 883e969..0000000
--- a/integrate_test/config-api/configcenter/nacos/docker/docker-compose.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
- nacos:
- image: nacos/nacos-server:1.2.0
- container_name: nacos-standalone
- environment:
- - PREFER_HOST_MODE=hostname
- - MODE=standalone
- ports:
- - "8848:8848"
- healthcheck:
- test: "curl --fail http://127.0.0.1:8848/nacos/v1/console/health/liveness || exit 1"
- interval: 5s
diff --git a/integrate_test/config-api/configcenter/nacos/docker/docker-health-check.sh b/integrate_test/config-api/configcenter/nacos/docker/docker-health-check.sh
deleted file mode 100644
index d5dd65b..0000000
--- a/integrate_test/config-api/configcenter/nacos/docker/docker-health-check.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-sleep 10
-curl http://127.0.0.1:8848/nacos/v1/console/health/liveness
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 30
-
-
diff --git a/integrate_test/config-api/configcenter/nacos/tests/integration/main_test.go b/integrate_test/config-api/configcenter/nacos/tests/integration/main_test.go
index 8a7912c..825c8db 100644
--- a/integrate_test/config-api/configcenter/nacos/tests/integration/main_test.go
+++ b/integrate_test/config-api/configcenter/nacos/tests/integration/main_test.go
@@ -50,7 +50,6 @@ dubbo:
var greeterProvider = new(dubbo3pb.GreeterClientImpl)
func TestMain(m *testing.M) {
- time.Sleep(time.Second * 20)
dynamicConfig, err := config.NewConfigCenterConfig(
config.WithConfigCenterProtocol("nacos"),
config.WithConfigCenterAddress("127.0.0.1:8848")).GetDynamicConfiguration()
diff --git a/integrate_test/config-api/configcenter/zookeeper/docker/docker-compose.yml b/integrate_test/config-api/configcenter/zookeeper/docker/docker-compose.yml
deleted file mode 100644
index 883e969..0000000
--- a/integrate_test/config-api/configcenter/zookeeper/docker/docker-compose.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
- nacos:
- image: nacos/nacos-server:1.2.0
- container_name: nacos-standalone
- environment:
- - PREFER_HOST_MODE=hostname
- - MODE=standalone
- ports:
- - "8848:8848"
- healthcheck:
- test: "curl --fail http://127.0.0.1:8848/nacos/v1/console/health/liveness || exit 1"
- interval: 5s
diff --git a/integrate_test/config-api/configcenter/zookeeper/tests/integration/main_test.go b/integrate_test/config-api/configcenter/zookeeper/tests/integration/main_test.go
index df44e74..51ba339 100644
--- a/integrate_test/config-api/configcenter/zookeeper/tests/integration/main_test.go
+++ b/integrate_test/config-api/configcenter/zookeeper/tests/integration/main_test.go
@@ -50,7 +50,6 @@ dubbo:
var greeterProvider = new(dubbo3pb.GreeterClientImpl)
func TestMain(m *testing.M) {
- time.Sleep(time.Second * 20)
dynamicConfig, err := config.NewConfigCenterConfig(
config.WithConfigCenterProtocol("zookeeper"),
config.WithConfigCenterAddress("127.0.0.1:2181")).GetDynamicConfiguration()
diff --git a/integrate_test/config-api/rpc/triple/docker/docker-compose.yml b/integrate_test/config-api/rpc/triple/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/config-api/rpc/triple/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/configcenter/apollo/docker/docker-compose.yml b/integrate_test/configcenter/apollo/docker/docker-compose.yml
deleted file mode 100644
index c8ecb42..0000000
--- a/integrate_test/configcenter/apollo/docker/docker-compose.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
- apollo-quick-start:
- image: nobodyiam/apollo-quick-start
- container_name: apollo-quick-start
- depends_on:
- - apollo-db
- ports:
- - "8080:8080"
- - "8070:8070"
- links:
- - apollo-db
-
- apollo-db:
- image: mysql:5.7
- container_name: apollo-db
- environment:
- TZ: Asia/Shanghai
- MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
- depends_on:
- - apollo-dbdata
- ports:
- - "13306:3306"
- volumes:
- - ./sql:/docker-entrypoint-initdb.d
- volumes_from:
- - apollo-dbdata
-
- apollo-dbdata:
- image: alpine:latest
- container_name: apollo-dbdata
- volumes:
- - /var/lib/mysql
\ No newline at end of file
diff --git a/integrate_test/configcenter/apollo/docker/docker-health-check.sh b/integrate_test/configcenter/apollo/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/configcenter/apollo/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/integrate_test/configcenter/apollo/docker/sql/apolloconfigdb.sql b/integrate_test/configcenter/apollo/docker/sql/apolloconfigdb.sql
deleted file mode 100644
index a883f05..0000000
--- a/integrate_test/configcenter/apollo/docker/sql/apolloconfigdb.sql
+++ /dev/null
@@ -1,433 +0,0 @@
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
-# Create Database
-# ------------------------------------------------------------
-CREATE DATABASE IF NOT EXISTS ApolloConfigDB DEFAULT CHARACTER SET = utf8mb4;
-
-Use ApolloConfigDB;
-
-# Dump of table app
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `App`;
-
-CREATE TABLE `App` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
- `OrgID` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门ID',
- `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
- `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
- `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID` (`AppID`(191)),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_Name` (`Name`(191))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
-
-
-
-# Dump of table appnamespace
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `AppNamespace`;
-
-CREATE TABLE `AppNamespace` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
- `AppID` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
- `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
- `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
- `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_AppID` (`AppID`),
- KEY `Name_AppID` (`Name`,`AppID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
-
-
-
-# Dump of table audit
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Audit`;
-
-CREATE TABLE `Audit` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `EntityName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '表名',
- `EntityID` int(10) unsigned DEFAULT NULL COMMENT '记录ID',
- `OpName` varchar(50) NOT NULL DEFAULT 'default' COMMENT '操作类型',
- `Comment` varchar(500) DEFAULT NULL COMMENT '备注',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='日志审计表';
-
-
-
-# Dump of table cluster
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Cluster`;
-
-CREATE TABLE `Cluster` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `Name` varchar(32) NOT NULL DEFAULT '' COMMENT '集群名字',
- `AppID` varchar(64) NOT NULL DEFAULT '' COMMENT 'App id',
- `ParentClusterID` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父cluster',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_AppID_Name` (`AppID`,`Name`),
- KEY `IX_ParentClusterID` (`ParentClusterID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集群';
-
-
-
-# Dump of table commit
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Commit`;
-
-CREATE TABLE `Commit` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `ChangeSets` longtext NOT NULL COMMENT '修改变更集',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
- `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
- `Comment` varchar(500) DEFAULT NULL COMMENT '备注',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `AppID` (`AppID`(191)),
- KEY `ClusterName` (`ClusterName`(191)),
- KEY `NamespaceName` (`NamespaceName`(191))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='commit 历史表';
-
-# Dump of table grayreleaserule
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `GrayReleaseRule`;
-
-CREATE TABLE `GrayReleaseRule` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `AppID` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
- `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
- `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'branch name',
- `Rules` varchar(16000) DEFAULT '[]' COMMENT '灰度规则',
- `ReleaseID` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '灰度对应的release',
- `BranchStatus` tinyint(2) DEFAULT '1' COMMENT '灰度分支状态: 0:删除分支,1:正在使用的规则 2:全量发布',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_Namespace` (`AppID`,`ClusterName`,`NamespaceName`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='灰度规则表';
-
-
-# Dump of table instance
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Instance`;
-
-CREATE TABLE `Instance` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `AppID` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
- `DataCenter` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Data Center Name',
- `Ip` varchar(32) NOT NULL DEFAULT '' COMMENT 'instance ip',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- UNIQUE KEY `IX_UNIQUE_KEY` (`AppID`,`ClusterName`,`Ip`,`DataCenter`),
- KEY `IX_IP` (`Ip`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='使用配置的应用实例';
-
-
-
-# Dump of table instanceconfig
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `InstanceConfig`;
-
-CREATE TABLE `InstanceConfig` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `InstanceID` int(11) unsigned DEFAULT NULL COMMENT 'Instance ID',
- `ConfigAppID` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'Config App ID',
- `ConfigClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Cluster Name',
- `ConfigNamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'Config Namespace Name',
- `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
- `ReleaseDeliveryTime` timestamp NULL DEFAULT NULL COMMENT '配置获取时间',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- UNIQUE KEY `IX_UNIQUE_KEY` (`InstanceID`,`ConfigAppID`,`ConfigNamespaceName`),
- KEY `IX_ReleaseKey` (`ReleaseKey`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_Valid_Namespace` (`ConfigAppID`,`ConfigClusterName`,`ConfigNamespaceName`,`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用实例的配置信息';
-
-
-
-# Dump of table item
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Item`;
-
-CREATE TABLE `Item` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `NamespaceID` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceID',
- `Key` varchar(128) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
- `Value` longtext NOT NULL COMMENT '配置项值',
- `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
- `LineNum` int(10) unsigned DEFAULT '0' COMMENT '行号',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_GroupID` (`NamespaceID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置项目';
-
-
-
-# Dump of table namespace
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Namespace`;
-
-CREATE TABLE `Namespace` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Cluster Name',
- `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'Namespace Name',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID_ClusterName_NamespaceName` (`AppID`(191),`ClusterName`(191),`NamespaceName`(191)),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_NamespaceName` (`NamespaceName`(191))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='命名空间';
-
-
-
-# Dump of table namespacelock
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `NamespaceLock`;
-
-CREATE TABLE `NamespaceLock` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
- `NamespaceID` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '集群NamespaceID',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT 'default' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- `IsDeleted` bit(1) DEFAULT b'0' COMMENT '软删除',
- PRIMARY KEY (`ID`),
- UNIQUE KEY `IX_NamespaceID` (`NamespaceID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='namespace的编辑锁';
-
-
-
-# Dump of table release
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Release`;
-
-CREATE TABLE `Release` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `ReleaseKey` varchar(64) NOT NULL DEFAULT '' COMMENT '发布的Key',
- `Name` varchar(64) NOT NULL DEFAULT 'default' COMMENT '发布名字',
- `Comment` varchar(256) DEFAULT NULL COMMENT '发布说明',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `ClusterName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
- `NamespaceName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
- `Configurations` longtext NOT NULL COMMENT '发布配置',
- `IsAbandoned` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否废弃',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID_ClusterName_GroupName` (`AppID`(191),`ClusterName`(191),`NamespaceName`(191)),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_ReleaseKey` (`ReleaseKey`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布';
-
-
-# Dump of table releasehistory
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ReleaseHistory`;
-
-CREATE TABLE `ReleaseHistory` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `AppID` varchar(64) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `ClusterName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'ClusterName',
- `NamespaceName` varchar(32) NOT NULL DEFAULT 'default' COMMENT 'namespaceName',
- `BranchName` varchar(32) NOT NULL DEFAULT 'default' COMMENT '发布分支名',
- `ReleaseID` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '关联的Release ID',
- `PreviousReleaseID` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '前一次发布的ReleaseID',
- `Operation` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '发布类型,0: 普通发布,1: 回滚,2: 灰度发布,3: 灰度规则更新,4: 灰度合并回主分支发布,5: 主分支发布灰度自动发布,6: 主分支回滚灰度自动发布,7: 放弃灰度',
- `OperationContext` longtext NOT NULL COMMENT '发布上下文信息',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_Namespace` (`AppID`,`ClusterName`,`NamespaceName`,`BranchName`),
- KEY `IX_ReleaseID` (`ReleaseID`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布历史';
-
-
-# Dump of table releasemessage
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ReleaseMessage`;
-
-CREATE TABLE `ReleaseMessage` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `Message` varchar(1024) NOT NULL DEFAULT '' COMMENT '发布的消息内容',
- `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_Message` (`Message`(191))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='发布消息';
-
-
-
-# Dump of table serverconfig
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ServerConfig`;
-
-CREATE TABLE `ServerConfig` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
- `Cluster` varchar(32) NOT NULL DEFAULT 'default' COMMENT '配置对应的集群,default为不针对特定的集群',
- `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
- `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_Key` (`Key`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
-
-# Dump of table accesskey
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `AccessKey`;
-
-CREATE TABLE `AccessKey` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `Secret` varchar(128) NOT NULL DEFAULT '' COMMENT 'Secret',
- `IsEnabled` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: enabled, 0: disabled',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID` (`AppID`(191)),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='访问密钥';
-
-# Config
-# ------------------------------------------------------------
-INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)
-VALUES
- ('eureka.service.url', 'default', 'http://localhost:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'),
- ('namespace.lock.switch', 'default', 'false', '一次发布只能有一个人修改开关'),
- ('item.value.length.limit', 'default', '20000', 'item value最大长度限制'),
- ('config-service.cache.enabled', 'default', 'false', 'ConfigService是否开启缓存,开启后能提高性能,但是会增大内存消耗!'),
- ('item.key.length.limit', 'default', '128', 'item key 最大长度限制');
-
-# Sample Data
-# ------------------------------------------------------------
-INSERT INTO `App` (`AppID`, `Name`, `OrgID`, `OrgName`, `OwnerName`, `OwnerEmail`)
-VALUES
- ('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com');
-
-INSERT INTO `AppNamespace` (`Name`, `AppID`, `Format`, `IsPublic`, `Comment`)
-VALUES
- ('application', 'SampleApp', 'properties', 0, 'default app namespace');
-
-INSERT INTO `Cluster` (`Name`, `AppID`)
-VALUES
- ('default', 'SampleApp');
-
-INSERT INTO `Namespace` (`ID`, `AppID`, `ClusterName`, `NamespaceName`)
-VALUES
- (1, 'SampleApp', 'default', 'application');
-
-
-INSERT INTO `Item` (`NamespaceID`, `Key`, `Value`, `Comment`, `LineNum`)
-VALUES
- (1, 'timeout', '100', 'sample timeout配置', 1);
-
-INSERT INTO `Release` (`ReleaseKey`, `Name`, `Comment`, `AppID`, `ClusterName`, `NamespaceName`, `Configurations`)
-VALUES
- ('20161009155425-d3a0749c6e20bc15', '20161009155424-release', 'Sample发布', 'SampleApp', 'default', 'application', '{\"timeout\":\"100\"}');
-
-INSERT INTO `ReleaseHistory` (`AppID`, `ClusterName`, `NamespaceName`, `BranchName`, `ReleaseID`, `PreviousReleaseID`, `Operation`, `OperationContext`, `DataChange_CreatedBy`, `DataChange_LastModifiedBy`)
-VALUES
- ('SampleApp', 'default', 'application', 'default', 1, 0, 0, '{}', 'apollo', 'apollo');
-
-INSERT INTO `ReleaseMessage` (`Message`)
-VALUES
- ('SampleApp+default+application');
-
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/integrate_test/configcenter/apollo/docker/sql/apolloportaldb.sql b/integrate_test/configcenter/apollo/docker/sql/apolloportaldb.sql
deleted file mode 100644
index f4c6f69..0000000
--- a/integrate_test/configcenter/apollo/docker/sql/apolloportaldb.sql
+++ /dev/null
@@ -1,368 +0,0 @@
-/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
-/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
-/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
-/*!40101 SET NAMES utf8 */;
-/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
-# Create Database
-# ------------------------------------------------------------
-CREATE DATABASE IF NOT EXISTS ApolloPortalDB DEFAULT CHARACTER SET = utf8mb4;
-
-Use ApolloPortalDB;
-
-# Dump of table app
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `App`;
-
-CREATE TABLE `App` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
- `OrgID` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门ID',
- `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
- `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
- `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID` (`AppID`(191)),
- KEY `DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_Name` (`Name`(191))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
-
-
-
-# Dump of table appnamespace
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `AppNamespace`;
-
-CREATE TABLE `AppNamespace` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
- `Name` varchar(32) NOT NULL DEFAULT '' COMMENT 'namespace名字,注意,需要全局唯一',
- `AppID` varchar(64) NOT NULL DEFAULT '' COMMENT 'app id',
- `Format` varchar(32) NOT NULL DEFAULT 'properties' COMMENT 'namespace的format类型',
- `IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
- `Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_AppID` (`AppID`),
- KEY `Name_AppID` (`Name`,`AppID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
-
-
-
-# Dump of table consumer
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Consumer`;
-
-CREATE TABLE `Consumer` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `Name` varchar(500) NOT NULL DEFAULT 'default' COMMENT '应用名',
- `OrgID` varchar(32) NOT NULL DEFAULT 'default' COMMENT '部门ID',
- `OrgName` varchar(64) NOT NULL DEFAULT 'default' COMMENT '部门名字',
- `OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
- `OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID` (`AppID`(191)),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='开放API消费者';
-
-
-
-# Dump of table consumeraudit
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ConsumerAudit`;
-
-CREATE TABLE `ConsumerAudit` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `ConsumerID` int(11) unsigned DEFAULT NULL COMMENT 'Consumer ID',
- `Uri` varchar(1024) NOT NULL DEFAULT '' COMMENT '访问的Uri',
- `Method` varchar(16) NOT NULL DEFAULT '' COMMENT '访问的Method',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_ConsumerID` (`ConsumerID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer审计表';
-
-
-
-# Dump of table consumerrole
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ConsumerRole`;
-
-CREATE TABLE `ConsumerRole` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `ConsumerID` int(11) unsigned DEFAULT NULL COMMENT 'Consumer ID',
- `RoleID` int(10) unsigned DEFAULT NULL COMMENT 'Role ID',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_RoleID` (`RoleID`),
- KEY `IX_ConsumerID_RoleID` (`ConsumerID`,`RoleID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer和role的绑定表';
-
-
-
-# Dump of table consumertoken
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ConsumerToken`;
-
-CREATE TABLE `ConsumerToken` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `ConsumerID` int(11) unsigned DEFAULT NULL COMMENT 'ConsumerID',
- `Token` varchar(128) NOT NULL DEFAULT '' COMMENT 'token',
- `Expires` datetime NOT NULL DEFAULT '2099-01-01 00:00:00' COMMENT 'token失效时间',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- UNIQUE KEY `IX_Token` (`Token`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer token表';
-
-# Dump of table favorite
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Favorite`;
-
-CREATE TABLE `Favorite` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `UserID` varchar(32) NOT NULL DEFAULT 'default' COMMENT '收藏的用户',
- `AppID` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
- `Position` int(32) NOT NULL DEFAULT '10000' COMMENT '收藏顺序',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `AppID` (`AppID`(191)),
- KEY `IX_UserID` (`UserID`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COMMENT='应用收藏表';
-
-# Dump of table permission
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Permission`;
-
-CREATE TABLE `Permission` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `PermissionType` varchar(32) NOT NULL DEFAULT '' COMMENT '权限类型',
- `TargetID` varchar(256) NOT NULL DEFAULT '' COMMENT '权限对象类型',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_TargetID_PermissionType` (`TargetID`(191),`PermissionType`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='permission表';
-
-
-
-# Dump of table role
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Role`;
-
-CREATE TABLE `Role` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `RoleName` varchar(256) NOT NULL DEFAULT '' COMMENT 'Role name',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_RoleName` (`RoleName`(191)),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
-
-
-
-# Dump of table rolepermission
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `RolePermission`;
-
-CREATE TABLE `RolePermission` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `RoleID` int(10) unsigned DEFAULT NULL COMMENT 'Role ID',
- `PermissionID` int(10) unsigned DEFAULT NULL COMMENT 'Permission ID',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_RoleID` (`RoleID`),
- KEY `IX_PermissionID` (`PermissionID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和权限的绑定表';
-
-
-
-# Dump of table serverconfig
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `ServerConfig`;
-
-CREATE TABLE `ServerConfig` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `Key` varchar(64) NOT NULL DEFAULT 'default' COMMENT '配置项Key',
- `Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
- `Comment` varchar(1024) DEFAULT '' COMMENT '注释',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_Key` (`Key`),
- KEY `DataChange_LastTime` (`DataChange_LastTime`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
-
-
-
-# Dump of table userrole
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `UserRole`;
-
-CREATE TABLE `UserRole` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `UserID` varchar(128) DEFAULT '' COMMENT '用户身份标识',
- `RoleID` int(10) unsigned DEFAULT NULL COMMENT 'Role ID',
- `IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
- `DataChange_CreatedBy` varchar(32) DEFAULT '' COMMENT '创建人邮箱前缀',
- `DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `DataChange_LastModifiedBy` varchar(32) DEFAULT '' COMMENT '最后修改人邮箱前缀',
- `DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
- PRIMARY KEY (`ID`),
- KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
- KEY `IX_RoleID` (`RoleID`),
- KEY `IX_UserID_RoleID` (`UserID`,`RoleID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和role的绑定表';
-
-# Dump of table Users
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Users`;
-
-CREATE TABLE `Users` (
- `ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `Username` varchar(64) NOT NULL DEFAULT 'default' COMMENT '用户名',
- `Password` varchar(64) NOT NULL DEFAULT 'default' COMMENT '密码',
- `Email` varchar(64) NOT NULL DEFAULT 'default' COMMENT '邮箱地址',
- `Enabled` tinyint(4) DEFAULT NULL COMMENT '是否有效',
- PRIMARY KEY (`ID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
-
-
-# Dump of table Authorities
-# ------------------------------------------------------------
-
-DROP TABLE IF EXISTS `Authorities`;
-
-CREATE TABLE `Authorities` (
- `ID` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
- `Username` varchar(64) NOT NULL,
- `Authority` varchar(50) NOT NULL,
- PRIMARY KEY (`ID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-
-
-# Config
-# ------------------------------------------------------------
-INSERT INTO `ServerConfig` (`Key`, `Value`, `Comment`)
-VALUES
-('apollo.portal.envs', 'dev', '可支持的环境列表'),
-('organizations', '[{\"orgID\":\"TEST1\",\"orgName\":\"样例部门1\"},{\"orgID\":\"TEST2\",\"orgName\":\"样例部门2\"}]', '部门列表'),
-('superAdmin', 'apollo', 'Portal超级管理员'),
-('api.readTimeout', '10000', 'http接口read timeout'),
-('consumer.token.salt', 'someSalt', 'consumer token salt'),
-('admin.createPrivateNamespace.switch', 'true', '是否允许项目管理员创建私有namespace'),
-('configView.memberOnly.envs', 'dev', '只对项目成员显示配置信息的环境列表,多个env以英文逗号分隔'),
-('apollo.portal.meta.servers', '{}', '各环境Meta Service列表');
-
-INSERT INTO `Users` (`Username`, `Password`, `Email`, `Enabled`)
-VALUES
-('apollo', '$2a$10$7r20uS.BQ9uBpf3Baj3uQOZvMVvB1RN3PYoKE94gtz2.WAOuiiwXS', 'apollo@acme.com', 1);
-
-INSERT INTO `Authorities` (`Username`, `Authority`) VALUES ('apollo', 'ROLE_user');
-
-# Sample Data
-# ------------------------------------------------------------
-INSERT INTO `App` (`AppID`, `Name`, `OrgID`, `OrgName`, `OwnerName`, `OwnerEmail`)
-VALUES
-('SampleApp', 'Sample App', 'TEST1', '样例部门1', 'apollo', 'apollo@acme.com');
-
-INSERT INTO `AppNamespace` (`Name`, `AppID`, `Format`, `IsPublic`, `Comment`)
-VALUES
-('application', 'SampleApp', 'properties', 0, 'default app namespace');
-
-INSERT INTO `Permission` (`ID`, `PermissionType`, `TargetID`)
-VALUES
-(1, 'CreateCluster', 'SampleApp'),
-(2, 'CreateNamespace', 'SampleApp'),
-(3, 'AssignRole', 'SampleApp'),
-(4, 'ModifyNamespace', 'SampleApp+application'),
-(5, 'ReleaseNamespace', 'SampleApp+application');
-
-INSERT INTO `Role` (`ID`, `RoleName`)
-VALUES
-(1, 'Master+SampleApp'),
-(2, 'ModifyNamespace+SampleApp+application'),
-(3, 'ReleaseNamespace+SampleApp+application');
-
-INSERT INTO `RolePermission` (`RoleID`, `PermissionID`)
-VALUES
-(1, 1),
-(1, 2),
-(1, 3),
-(2, 4),
-(3, 5);
-
-INSERT INTO `UserRole` (`UserID`, `RoleID`)
-VALUES
-('apollo', 1),
-('apollo', 2),
-('apollo', 3);
-
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
-/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
-/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
-/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
-/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/integrate_test/configcenter/nacos/conf/client.yml b/integrate_test/configcenter/nacos/conf/client.yml
deleted file mode 100644
index 623d92d..0000000
--- a/integrate_test/configcenter/nacos/conf/client.yml
+++ /dev/null
@@ -1,64 +0,0 @@
-# dubbo client yaml configure file
-
-check: true
-# client
-request_timeout: "3s"
-# connect timeout
-connect_timeout: "3s"
-
-# config center config
-config_center:
- protocol: "nacos"
- address: "127.0.0.1:8848"
-
-# application config
-application:
- organization: "dubbo.io"
- name: "user-info-client"
- module: "dubbo-go user-info client"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-# reference config
-references:
- "UserProvider":
- registry: "demoZk"
- protocol: "dubbo"
- interface: "org.apache.dubbo.UserProvider"
- cluster: "failover"
- methods:
- - name: "GetUser"
- retries: 3
-
-# protocol config
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 1
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024000
- session_name: "client"
diff --git a/integrate_test/configcenter/nacos/conf/log.yml b/integrate_test/configcenter/nacos/conf/log.yml
deleted file mode 100644
index a75bccb..0000000
--- a/integrate_test/configcenter/nacos/conf/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "error"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capital"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/integrate_test/configcenter/nacos/conf/server.yml b/integrate_test/configcenter/nacos/conf/server.yml
deleted file mode 100644
index dbea78e..0000000
--- a/integrate_test/configcenter/nacos/conf/server.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-# dubbo server yaml configure file
-
-# config center config
-config_center:
- protocol: "nacos"
- address: "127.0.0.1:8848"
-
-# application config
-application:
- organization: "dubbo.io"
- name: "user-info-server"
- module: "dubbo-go user-info server"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
-
-# service config
-services:
- "UserProvider":
- registry: "demoZk"
- protocol: "dubbo"
- interface: "org.apache.dubbo.UserProvider"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "GetUser"
- retries: 1
- loadbalance: "random"
-
-# protocol config
-protocols:
- "dubbo":
- name: "dubbo"
- port: 20000
-
-protocol_conf:
- dubbo:
- session_number: 700
- session_timeout: "180s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024000
- session_name: "server"
diff --git a/integrate_test/configcenter/nacos/docker/docker-compose.yml b/integrate_test/configcenter/nacos/docker/docker-compose.yml
deleted file mode 100644
index cf35093..0000000
--- a/integrate_test/configcenter/nacos/docker/docker-compose.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
- nacos:
- image: nacos/nacos-server:1.2.0
- container_name: nacos-standalone
- environment:
- - PREFER_HOST_MODE=hostname
- - MODE=standalone
- ports:
- - "8848:8848"
- healthcheck:
- test: "curl --fail http://127.0.0.1:8848/nacos/v1/console/health/liveness || exit 1"
- interval: 5s
diff --git a/integrate_test/configcenter/nacos/docker/docker-health-check.sh b/integrate_test/configcenter/nacos/docker/docker-health-check.sh
deleted file mode 100644
index b50ccf8..0000000
--- a/integrate_test/configcenter/nacos/docker/docker-health-check.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-sleep 10
-curl http://127.0.0.1:8848/nacos/v1/console/health/liveness
-sleep 30
\ No newline at end of file
diff --git a/integrate_test/context/dubbo/conf/client.yml b/integrate_test/context/dubbo/conf/client.yml
deleted file mode 100644
index 3e547b4..0000000
--- a/integrate_test/context/dubbo/conf/client.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-# dubbo client yaml configure file
-
-check: true
-# client
-request_timeout: "3s"
-# connect timeout
-connect_timeout: "3s"
-
-# application config
-application:
- organization: "dubbo.io"
- name: "UserInfoTest"
- module: "dubbo-go user-info client"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-# reference config
-references:
- "UserProvider":
- registry: "demoZk"
- protocol: "dubbo"
- interface: "org.apache.dubbo.UserProvider"
- cluster: "failover"
- methods:
- - name: "GetContext"
- retries: 3
-
-# protocol config
-protocol_conf:
- dubbo:
- reconnect_interval: 0
- connection_number: 1
- heartbeat_period: "5s"
- session_timeout: "180s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024000
- session_name: "client"
diff --git a/integrate_test/context/dubbo/conf/log.yml b/integrate_test/context/dubbo/conf/log.yml
deleted file mode 100644
index 970d988..0000000
--- a/integrate_test/context/dubbo/conf/log.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-level: "error"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capital"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/integrate_test/context/dubbo/conf/server.yml b/integrate_test/context/dubbo/conf/server.yml
deleted file mode 100644
index 55354ee..0000000
--- a/integrate_test/context/dubbo/conf/server.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# dubbo server yaml configure file
-
-# application config
-application:
- organization: "dubbo.io"
- name: "UserInfoServer"
- module: "dubbo-go user-info server"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
-
-# service config
-services:
- "UserProvider":
- registry: "demoZk"
- protocol: "dubbo"
- interface: "org.apache.dubbo.UserProvider"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "GetContext"
- retries: 1
- loadbalance: "random"
-
-# protocol config
-protocols:
- "dubbo":
- name: "dubbo"
- port: 20000
-
-protocol_conf:
- dubbo:
- session_number: 700
- session_timeout: "180s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024000
- session_name: "server"
diff --git a/integrate_test/direct/docker/docker-compose.yml b/integrate_test/direct/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/direct/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/direct/docker/docker-health-check.sh b/integrate_test/direct/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/direct/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/integrate_test/config-api/configcenter/zookeeper/docker/docker-health-check.sh b/integrate_test/dockercompose/docker-health-check.sh
similarity index 95%
rename from integrate_test/config-api/configcenter/zookeeper/docker/docker-health-check.sh
rename to integrate_test/dockercompose/docker-health-check.sh
index b975020..5dee56a 100644
--- a/integrate_test/config-api/configcenter/zookeeper/docker/docker-health-check.sh
+++ b/integrate_test/dockercompose/docker-health-check.sh
@@ -1,5 +1,3 @@
-sleep 10
-curl http://127.0.0.1:8848/nacos/v1/console/health/liveness
curl 127.0.0.1:2181
res=$?
passCode=52
@@ -9,4 +7,7 @@ while [ "$res" != "$passCode" ];do
res=$?
done
-sleep 30
+sleep 5
+curl http://127.0.0.1:8848/nacos/v1/console/health/liveness
+sleep 10
+
diff --git a/integrate_test/helloworld/docker/docker-compose.yml b/integrate_test/helloworld/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/helloworld/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/helloworld/docker/docker-health-check.sh b/integrate_test/helloworld/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/helloworld/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/integrate_test/registry/nacos/docker/docker-compose.yml b/integrate_test/registry/nacos/docker/docker-compose.yml
deleted file mode 100644
index cc43430..0000000
--- a/integrate_test/registry/nacos/docker/docker-compose.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-version: "3"
-
-services:
- nacos:
- image: nacos/nacos-server:1.2.0
- container_name: nacos-standalone
- environment:
- - PREFER_HOST_MODE=hostname
- - MODE=standalone
- ports:
- - "8848:8848"
- healthcheck:
- test: "curl --fail http://127.0.0.1:8848/nacos/v1/console/health/liveness || exit 1"
- interval: 5s
diff --git a/integrate_test/registry/nacos/docker/docker-health-check.sh b/integrate_test/registry/nacos/docker/docker-health-check.sh
deleted file mode 100644
index 128612c..0000000
--- a/integrate_test/registry/nacos/docker/docker-health-check.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-sleep 10
-curl http://127.0.0.1:8848/nacos/v1/console/health/liveness
-sleep 30
-
diff --git a/integrate_test/registry/zookeeper/docker/docker-compose.yml b/integrate_test/registry/zookeeper/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/registry/zookeeper/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/registry/zookeeper/docker/docker-health-check.sh b/integrate_test/registry/zookeeper/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/registry/zookeeper/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/integrate_test/rpc/dubbo/docker/docker-compose.yml b/integrate_test/rpc/dubbo/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/rpc/dubbo/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/rpc/dubbo/docker/docker-health-check.sh b/integrate_test/rpc/dubbo/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/rpc/dubbo/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/rpc/grpc/go-server/tests/integration/greeter_test.go b/integrate_test/rpc/grpc/tests/integration/greeter_test.go
similarity index 83%
rename from rpc/grpc/go-server/tests/integration/greeter_test.go
rename to integrate_test/rpc/grpc/tests/integration/greeter_test.go
index f49e5a1..290366a 100644
--- a/rpc/grpc/go-server/tests/integration/greeter_test.go
+++ b/integrate_test/rpc/grpc/tests/integration/greeter_test.go
@@ -1,5 +1,3 @@
-// +build integration
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -29,16 +27,15 @@ import (
)
import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
+ pb "github.com/apache/dubbo-go-samples/rpc/grpc/protobuf"
)
func TestGreeter(t *testing.T) {
- reply := &protobuf.HelloReply{}
- req := &protobuf.HelloRequest{
+ req := &pb.HelloRequest{
Name: "xujianhai",
}
- err := grpcGreeterImpl.SayHello(context.TODO(), req, reply)
+ reply, err := grpcGreeterImpl.SayHello(context.TODO(), req)
assert.Nil(t, err)
assert.Equal(t, "this is message from reply", reply.Message)
}
diff --git a/rpc/grpc/stream/go-client/app/version.go b/integrate_test/rpc/grpc/tests/integration/main_test.go
similarity index 66%
rename from rpc/grpc/stream/go-client/app/version.go
rename to integrate_test/rpc/grpc/tests/integration/main_test.go
index ae51f45..c44de5a 100644
--- a/rpc/grpc/stream/go-client/app/version.go
+++ b/integrate_test/rpc/grpc/tests/integration/main_test.go
@@ -15,8 +15,29 @@
* limitations under the License.
*/
-package main
+package integration
-var (
- Version = "2.7.5"
+import (
+ "os"
+ "testing"
+ "time"
)
+
+import (
+ "dubbo.apache.org/dubbo-go/v3/config"
+ _ "dubbo.apache.org/dubbo-go/v3/imports"
+)
+
+import (
+ pb "github.com/apache/dubbo-go-samples/rpc/grpc/protobuf"
+)
+
+var grpcGreeterImpl = new(pb.GreeterClientImpl)
+
+func TestMain(m *testing.M) {
+ config.SetConsumerService(grpcGreeterImpl)
+ config.Load()
+ time.Sleep(3 * time.Second)
+
+ os.Exit(m.Run())
+}
diff --git a/integrate_test/rpc/triple/codec-extension/docker/docker-compose.yml b/integrate_test/rpc/triple/codec-extension/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/rpc/triple/codec-extension/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/rpc/triple/codec-extension/docker/docker-health-check.sh b/integrate_test/rpc/triple/codec-extension/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/rpc/triple/codec-extension/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/integrate_test/rpc/triple/hessian2/docker/docker-compose.yml b/integrate_test/rpc/triple/hessian2/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/rpc/triple/hessian2/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/rpc/triple/hessian2/docker/docker-health-check.sh b/integrate_test/rpc/triple/hessian2/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/rpc/triple/hessian2/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/integrate_test/rpc/triple/pb/dubbogo-grpc/docker/docker-compose.yml b/integrate_test/rpc/triple/pb/dubbogo-grpc/docker/docker-compose.yml
deleted file mode 100644
index 8724179..0000000
--- a/integrate_test/rpc/triple/pb/dubbogo-grpc/docker/docker-compose.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-version: '3'
-
-services:
- zookeeper:
- image: zookeeper
- ports:
- - 2181:2181
- restart: on-failure
-
diff --git a/integrate_test/rpc/triple/pb/dubbogo-grpc/docker/docker-health-check.sh b/integrate_test/rpc/triple/pb/dubbogo-grpc/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/integrate_test/rpc/triple/pb/dubbogo-grpc/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/rpc/grpc/go-client/cmd/client.go b/rpc/grpc/go-client/cmd/client.go
index c2e7fca..afad682 100644
--- a/rpc/grpc/go-client/cmd/client.go
+++ b/rpc/grpc/go-client/cmd/client.go
@@ -23,24 +23,17 @@ import (
)
import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
"dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ _ "dubbo.apache.org/dubbo-go/v3/imports"
"github.com/dubbogo/gost/log"
)
import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
+ pb "github.com/apache/dubbo-go-samples/rpc/grpc/protobuf"
)
-var grpcGreeterImpl = new(protobuf.GreeterClientImpl)
+var grpcGreeterImpl = new(pb.GreeterClientImpl)
func init() {
config.SetConsumerService(grpcGreeterImpl)
@@ -52,7 +45,7 @@ func main() {
time.Sleep(3 * time.Second)
gxlog.CInfo("\n\n\nstart to test dubbo")
- req := &protobuf.HelloRequest{
+ req := &pb.HelloRequest{
Name: "xujianhai",
}
reply, err := grpcGreeterImpl.SayHello(context.TODO(), req)
diff --git a/rpc/grpc/go-client/conf/client.yml b/rpc/grpc/go-client/conf/client.yml
deleted file mode 100644
index 9342221..0000000
--- a/rpc/grpc/go-client/conf/client.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-# dubbo client yaml configure file
-
-check: true
-# client
-request_timeout: "3s"
-# connect timeout
-connect_timeout: "3s"
-
-# application config
-application:
- organization: "dubbo.io"
- name: "GreeterGrpcConsumer"
- module: "dubbo-go greeter grpc client"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-# reference config
-references:
- "greeterImpl":
- registry: "demoZk"
- protocol: "grpc"
- interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 3
-
-# protocol config
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
\ No newline at end of file
diff --git a/rpc/grpc/go-client/conf/dubbogo.yml b/rpc/grpc/go-client/conf/dubbogo.yml
new file mode 100644
index 0000000..4f14354
--- /dev/null
+++ b/rpc/grpc/go-client/conf/dubbogo.yml
@@ -0,0 +1,15 @@
+# dubbo client yaml configure file
+
+dubbo:
+ registries:
+ "demoZK":
+ protocol: "zookeeper"
+ timeout: "3s"
+ address: "127.0.0.1:2181"
+ consumer:
+ registry:
+ - demoZK
+ references:
+ GreeterClientImpl:
+ protocol: grpc
+ interface: "org.apache.dubbo.UserProvider"
\ No newline at end of file
diff --git a/rpc/grpc/go-client/conf/log.yml b/rpc/grpc/go-client/conf/log.yml
deleted file mode 100644
index 2b6e93a..0000000
--- a/rpc/grpc/go-client/conf/log.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-level: "debug"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capital"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/go-server/cmd/server.go b/rpc/grpc/go-server/cmd/server.go
index 81db1ab..8448364 100644
--- a/rpc/grpc/go-server/cmd/server.go
+++ b/rpc/grpc/go-server/cmd/server.go
@@ -18,6 +18,7 @@
package main
import (
+ "context"
"fmt"
"os"
"os/signal"
@@ -26,29 +27,36 @@ import (
)
import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
"dubbo.apache.org/dubbo-go/v3/common/logger"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
"dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
+ _ "dubbo.apache.org/dubbo-go/v3/imports"
)
import (
- "github.com/apache/dubbo-go-samples/general/grpc/go-server/pkg"
+ pb "github.com/apache/dubbo-go-samples/rpc/grpc/protobuf"
)
var (
survivalTimeout = int(3 * time.Second)
)
+
+type GreeterProvider struct {
+ pb.GreeterProviderBase
+}
+
+func (g *GreeterProvider) SayHello(ctx context.Context, req *pb.HelloRequest) (reply *pb.HelloReply, err error) {
+ fmt.Printf("req: %v", req)
+ return &pb.HelloReply{Message: "this is message from reply"}, nil
+}
+
+
// need to setup environment variable "CONF_PROVIDER_FILE_PATH" to "conf/server.yml" before run
func main() {
- config.SetProviderService(pkg.NewGreeterProvider())
- config.Load()
+ config.SetProviderService(&GreeterProvider{})
+ if err := config.Load(); err != nil{
+ panic(err)
+ }
initSignal()
}
diff --git a/rpc/grpc/go-server/conf/client.yml b/rpc/grpc/go-server/conf/client.yml
deleted file mode 100644
index 53ac35c..0000000
--- a/rpc/grpc/go-server/conf/client.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-# dubbo client yaml configure file
-
-check: true
-# client
-request_timeout: "3s"
-# connect timeout
-connect_timeout: "3s"
-
-# application config
-application:
- organization: "dubbo.io"
- name: "GreeterGrpcTest"
- module: "dubbo-go greeter grpc client"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-# reference config
-references:
- "greeterImpl":
- registry: "demoZk"
- protocol: "grpc"
- interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 3
-
-# protocol config
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
diff --git a/rpc/grpc/go-server/conf/dubbogo.yml b/rpc/grpc/go-server/conf/dubbogo.yml
new file mode 100644
index 0000000..800082b
--- /dev/null
+++ b/rpc/grpc/go-server/conf/dubbogo.yml
@@ -0,0 +1,19 @@
+# dubbo server yaml configure file
+
+dubbo:
+ registries:
+ "demoZK":
+ protocol: "zookeeper"
+ timeout: "3s"
+ address: "127.0.0.1:2181"
+ protocols:
+ grpcProtocol:
+ name: grpc
+ port: 20000
+ provider:
+ registry:
+ - demoZK
+ services:
+ GreeterProvider:
+ protocol: grpcProtocol
+ interface: "org.apache.dubbo.UserProvider"
\ No newline at end of file
diff --git a/rpc/grpc/go-server/conf/log.yml b/rpc/grpc/go-server/conf/log.yml
deleted file mode 100644
index 970d988..0000000
--- a/rpc/grpc/go-server/conf/log.yml
+++ /dev/null
@@ -1,27 +0,0 @@
-level: "error"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capital"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/go-server/conf/server.yml b/rpc/grpc/go-server/conf/server.yml
deleted file mode 100644
index 6cf6d5d..0000000
--- a/rpc/grpc/go-server/conf/server.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# dubbo server yaml configure file
-
-# application config
-application:
- organization: "dubbo.io"
- name: "GreeterGrpcServer"
- module: "dubbo-go greeter grpc server"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "zk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
-
-# service config
-services:
- "greeterImpl":
- registry: "zk"
- protocol: "grpc"
- interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-# protocol config
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
\ No newline at end of file
diff --git a/rpc/grpc/go-server/docker/docker-compose.yml b/rpc/grpc/go-server/docker/docker-compose.yml
deleted file mode 100644
index a2691e2..0000000
--- a/rpc/grpc/go-server/docker/docker-compose.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-version: '3.5'
-
-services:
- zk:
- image: zookeeper
- container_name: zk
- networks:
- - dubbo
- ports:
- - 2181:2181
-# 网络
-networks:
- dubbo:
- name: dubbo-go-samples
- driver: bridge
diff --git a/rpc/grpc/go-server/docker/docker-health-check.sh b/rpc/grpc/go-server/docker/docker-health-check.sh
deleted file mode 100644
index 2cc32c2..0000000
--- a/rpc/grpc/go-server/docker/docker-health-check.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-curl 127.0.0.1:2181
-res=$?
-passCode=52
-while [ "$res" != "$passCode" ];do
- sleep 5
- curl 127.0.0.1:2181
- res=$?
-done
-
-sleep 5
diff --git a/rpc/grpc/go-server/pkg/greeter.go b/rpc/grpc/go-server/pkg/greeter.go
deleted file mode 100644
index f205f39..0000000
--- a/rpc/grpc/go-server/pkg/greeter.go
+++ /dev/null
@@ -1,42 +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 pkg
-
-import (
- "context"
- "fmt"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
-)
-
-type GreeterProvider struct {
- *protobuf.GreeterProviderBase
-}
-
-func NewGreeterProvider() *GreeterProvider {
- return &GreeterProvider{
- GreeterProviderBase: &protobuf.GreeterProviderBase{},
- }
-}
-
-func (g *GreeterProvider) SayHello(ctx context.Context, req *protobuf.HelloRequest) (reply *protobuf.HelloReply, err error) {
- fmt.Printf("req: %v", req)
- return &protobuf.HelloReply{Message: "this is message from reply"}, nil
-}
diff --git a/rpc/grpc/go-server/tests/integration/main_test.go b/rpc/grpc/go-server/tests/integration/main_test.go
deleted file mode 100644
index 93708e9..0000000
--- a/rpc/grpc/go-server/tests/integration/main_test.go
+++ /dev/null
@@ -1,52 +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"
- "time"
-)
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-)
-
-import (
- "github.com/apache/dubbo-go-samples/general/grpc/protobuf"
-)
-
-var grpcGreeterImpl = new(protobuf.GreeterClientImpl)
-
-func TestMain(m *testing.M) {
- config.SetConsumerService(grpcGreeterImpl)
- config.Load()
- time.Sleep(3 * time.Second)
-
- os.Exit(m.Run())
-}
diff --git a/rpc/grpc/protobuf/helloworld.pb.go b/rpc/grpc/protobuf/helloworld.pb.go
index 887f23d..daa63fc 100644
--- a/rpc/grpc/protobuf/helloworld.pb.go
+++ b/rpc/grpc/protobuf/helloworld.pb.go
@@ -6,21 +6,19 @@ package protobuf
import (
context "context"
fmt "fmt"
+ proto "github.com/golang/protobuf/proto"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
math "math"
)
import (
"dubbo.apache.org/dubbo-go/v3/protocol"
- dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
"dubbo.apache.org/dubbo-go/v3/protocol/invocation"
-
- proto "github.com/golang/protobuf/proto"
-
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
)
+// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
@@ -221,17 +219,23 @@ var _Greeter_serviceDesc = grpc.ServiceDesc{
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type GreeterClientImpl struct {
// Sends a greeting
- SayHello func(ctx context.Context, in *HelloRequest, out *HelloReply) error
-}
-
-func (c *GreeterClientImpl) Reference() string {
- return "greeterImpl"
+ SayHello func(ctx context.Context, in *HelloRequest) (HelloReply, error)
}
func (c *GreeterClientImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient {
return NewGreeterClient(cc)
}
+// DubboGrpcService is gRPC service
+type DubboGrpcService interface {
+ // SetProxyImpl sets proxy.
+ SetProxyImpl(impl protocol.Invoker)
+ // GetProxyImpl gets proxy.
+ GetProxyImpl() protocol.Invoker
+ // ServiceDesc gets an RPC service's specification.
+ ServiceDesc() *grpc.ServiceDesc
+}
+
type GreeterProviderBase struct {
proxyImpl protocol.Invoker
}
@@ -244,16 +248,12 @@ func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
-func (c *GreeterProviderBase) Reference() string {
- return "greeterImpl"
-}
-
func _DUBBO_Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(HelloRequest)
if err := dec(in); err != nil {
return nil, err
}
- base := srv.(dgrpc.DubboGrpcService)
+ base := srv.(DubboGrpcService)
args := []interface{}{}
args = append(args, in)
invo := invocation.NewRPCInvocation("SayHello", args, nil)
diff --git a/rpc/grpc/stream/go-client/app/Makefile b/rpc/grpc/stream/go-client/app/Makefile
deleted file mode 100644
index be60da1..0000000
--- a/rpc/grpc/stream/go-client/app/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-gen:
- protoc -I ./ helloworld.proto --go_out=plugins=grpc:.
diff --git a/rpc/grpc/stream/go-client/app/client.go b/rpc/grpc/stream/go-client/app/client.go
deleted file mode 100644
index 9a77f80..0000000
--- a/rpc/grpc/stream/go-client/app/client.go
+++ /dev/null
@@ -1,148 +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"
- "fmt"
- "os"
- "os/signal"
- "syscall"
- "time"
-)
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- "dubbo.apache.org/dubbo-go/v3/common/logger"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/dubbo"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-
- gxlog "github.com/dubbogo/gost/log"
-)
-
-var (
- survivalTimeout int = 10e9
-)
-
-var grpcGreeterImpl = new(GreeterClientImpl)
-
-func init() {
- config.SetConsumerService(grpcGreeterImpl)
-}
-
-// they are necessary:
-// export CONF_CONSUMER_FILE_PATH="xxx"
-// export APP_LOG_CONF_FILE="xxx"
-func main() {
- config.Load()
- time.Sleep(time.Second)
-
- gxlog.CInfo("\n\n\n===== start to test SayHelloTwoSidesStream ======")
- reply := &HelloReply{}
- stream, err := grpcGreeterImpl.SayHelloTwoSidesStream(context.TODO())
- if err != nil {
- logger.Errorf("stream get err = %s", err.Error())
- return
- }
-
- if err := stream.Send(&HelloRequest{Name: "request 1"}); err != nil {
- logger.Errorf("send stream req err = %s", err.Error())
- }
- if err := stream.Send(&HelloRequest{Name: "request 2"}); err != nil {
- logger.Errorf("send stream req err = %s", err.Error())
- }
- reply, err = stream.Recv()
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("client response result: %v\n", reply)
- reply, err = stream.Recv()
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("client response result: %v\n", reply)
-
- gxlog.CInfo("\n\n\n===== start to test SayHelloClientStream =====")
- clientStream, err := grpcGreeterImpl.SayHelloClientStream(context.TODO())
- if err != nil {
- logger.Errorf("stream get err = %s", err.Error())
- return
- }
-
- if err := clientStream.Send(&HelloRequest{Name: "request 1"}); err != nil {
- logger.Errorf("send stream req err = %s", err.Error())
- }
- if err := clientStream.Send(&HelloRequest{Name: "request 2"}); err != nil {
- logger.Errorf("send stream req err = %s", err.Error())
- }
- err = clientStream.RecvMsg(reply)
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("client response result: %v\n", reply)
-
- gxlog.CInfo("\n\n\n===== start to test SayHelloServerStream =====")
- req := &HelloRequest{}
- serverStream, err := grpcGreeterImpl.SayHelloServerStream(context.TODO(), req)
- if err != nil {
- logger.Errorf("stream get err = %s", err.Error())
- return
- }
- reply, err = serverStream.Recv()
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("client response result: %v\n", reply)
- reply, err = serverStream.Recv()
- if err != nil {
- panic(err)
- }
- gxlog.CInfo("client response result: %v\n", reply)
-
- initSignal()
-}
-
-func initSignal() {
- signals := make(chan os.Signal, 1)
- // It is not possible to block SIGKILL or syscall.SIGSTOP
- signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGHUP,
- syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
- for {
- sig := <-signals
- logger.Infof("get signal %s", sig.String())
- switch sig {
- case syscall.SIGHUP:
- // reload()
- default:
- time.AfterFunc(time.Duration(survivalTimeout), func() {
- logger.Warnf("app exit now by force...")
- os.Exit(1)
- })
-
- // The program exits normally or timeout forcibly exits.
- fmt.Println("app exit now...")
- return
- }
- }
-}
diff --git a/rpc/grpc/stream/go-client/app/helloworld.pb.go b/rpc/grpc/stream/go-client/app/helloworld.pb.go
deleted file mode 100644
index bc59eb1..0000000
--- a/rpc/grpc/stream/go-client/app/helloworld.pb.go
+++ /dev/null
@@ -1,477 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: helloworld.proto
-
-package main
-
-import (
- context "context"
- fmt "fmt"
- math "math"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/protocol"
- dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
-
- proto "github.com/golang/protobuf/proto"
-
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
-// The request message containing the user's name.
-type HelloRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloRequest) Reset() { *m = HelloRequest{} }
-func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
-func (*HelloRequest) ProtoMessage() {}
-func (*HelloRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{0}
-}
-
-func (m *HelloRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloRequest.Unmarshal(m, b)
-}
-func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic)
-}
-func (m *HelloRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloRequest.Merge(m, src)
-}
-func (m *HelloRequest) XXX_Size() int {
- return xxx_messageInfo_HelloRequest.Size(m)
-}
-func (m *HelloRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloRequest proto.InternalMessageInfo
-
-func (m *HelloRequest) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-// The response message containing the greetings
-type HelloReply struct {
- Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloReply) Reset() { *m = HelloReply{} }
-func (m *HelloReply) String() string { return proto.CompactTextString(m) }
-func (*HelloReply) ProtoMessage() {}
-func (*HelloReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{1}
-}
-
-func (m *HelloReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloReply.Unmarshal(m, b)
-}
-func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic)
-}
-func (m *HelloReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloReply.Merge(m, src)
-}
-func (m *HelloReply) XXX_Size() int {
- return xxx_messageInfo_HelloReply.Size(m)
-}
-func (m *HelloReply) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloReply.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloReply proto.InternalMessageInfo
-
-func (m *HelloReply) GetMessage() string {
- if m != nil {
- return m.Message
- }
- return ""
-}
-
-func init() {
- proto.RegisterType((*HelloRequest)(nil), "main.HelloRequest")
- proto.RegisterType((*HelloReply)(nil), "main.HelloReply")
-}
-
-func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_17b8c58d586b62f2) }
-
-var fileDescriptor_17b8c58d586b62f2 = []byte{
- // 232 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9,
- 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xc9, 0x4d,
- 0xcc, 0xcc, 0x53, 0x52, 0xe2, 0xe2, 0xf1, 0x00, 0xc9, 0x04, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97,
- 0x08, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81,
- 0xd9, 0x4a, 0x6a, 0x5c, 0x5c, 0x50, 0x35, 0x05, 0x39, 0x95, 0x42, 0x12, 0x5c, 0xec, 0xb9, 0xa9,
- 0xc5, 0xc5, 0x89, 0xe9, 0x30, 0x45, 0x30, 0xae, 0xd1, 0x65, 0x46, 0x2e, 0x76, 0xf7, 0xa2, 0xd4,
- 0xd4, 0x92, 0xd4, 0x22, 0x21, 0x17, 0x2e, 0xb1, 0xe0, 0xc4, 0x4a, 0xb0, 0xb6, 0x90, 0xf2, 0xfc,
- 0xe0, 0xcc, 0x94, 0xd4, 0xe2, 0xe0, 0x92, 0xa2, 0xd4, 0xc4, 0x5c, 0x21, 0x21, 0x3d, 0x90, 0xc5,
- 0x7a, 0xc8, 0xb6, 0x4a, 0x09, 0xa0, 0x88, 0x15, 0xe4, 0x54, 0x2a, 0x31, 0x68, 0x30, 0x1a, 0x30,
- 0x0a, 0x39, 0x70, 0x89, 0xc0, 0x4c, 0x71, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0x21, 0xd5, 0x0c, 0x64,
- 0x13, 0x82, 0x53, 0x8b, 0xca, 0x52, 0x8b, 0x48, 0x33, 0xc1, 0x80, 0xd1, 0xc9, 0x8c, 0x4b, 0x3a,
- 0x33, 0x5f, 0x2f, 0xbd, 0xa8, 0x20, 0x59, 0x2f, 0xb5, 0x22, 0x31, 0xb7, 0x20, 0x27, 0xb5, 0x58,
- 0x0f, 0x11, 0x98, 0x4e, 0xfc, 0x60, 0xe5, 0xe1, 0x20, 0x76, 0x00, 0x28, 0x5c, 0x03, 0x18, 0x17,
- 0x31, 0x31, 0x7b, 0xf8, 0x84, 0x27, 0xb1, 0x81, 0x83, 0xd9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff,
- 0xe7, 0x0c, 0xb8, 0x0a, 0x7a, 0x01, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// GreeterClient is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClient interface {
- // Sends a greeting
- SayHelloTwoSidesStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloTwoSidesStreamClient, error)
- SayHelloClientStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloClientStreamClient, error)
- SayHelloServerStream(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Greeter_SayHelloServerStreamClient, error)
-}
-
-type greeterClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
- return &greeterClient{cc}
-}
-
-func (c *greeterClient) SayHelloTwoSidesStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloTwoSidesStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Greeter_serviceDesc.Streams[0], "/main.Greeter/SayHelloTwoSidesStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &greeterSayHelloTwoSidesStreamClient{stream}
- return x, nil
-}
-
-type Greeter_SayHelloTwoSidesStreamClient interface {
- Send(*HelloRequest) error
- Recv() (*HelloReply, error)
- grpc.ClientStream
-}
-
-type greeterSayHelloTwoSidesStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *greeterSayHelloTwoSidesStreamClient) Send(m *HelloRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloTwoSidesStreamClient) Recv() (*HelloReply, error) {
- m := new(HelloReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *greeterClient) SayHelloClientStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloClientStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Greeter_serviceDesc.Streams[1], "/main.Greeter/SayHelloClientStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &greeterSayHelloClientStreamClient{stream}
- return x, nil
-}
-
-type Greeter_SayHelloClientStreamClient interface {
- Send(*HelloRequest) error
- CloseAndRecv() (*HelloReply, error)
- grpc.ClientStream
-}
-
-type greeterSayHelloClientStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *greeterSayHelloClientStreamClient) Send(m *HelloRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloClientStreamClient) CloseAndRecv() (*HelloReply, error) {
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- m := new(HelloReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *greeterClient) SayHelloServerStream(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Greeter_SayHelloServerStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Greeter_serviceDesc.Streams[2], "/main.Greeter/SayHelloServerStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &greeterSayHelloServerStreamClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Greeter_SayHelloServerStreamClient interface {
- Recv() (*HelloReply, error)
- grpc.ClientStream
-}
-
-type greeterSayHelloServerStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *greeterSayHelloServerStreamClient) Recv() (*HelloReply, error) {
- m := new(HelloReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// GreeterServer is the server API for Greeter service.
-type GreeterServer interface {
- // Sends a greeting
- SayHelloTwoSidesStream(Greeter_SayHelloTwoSidesStreamServer) error
- SayHelloClientStream(Greeter_SayHelloClientStreamServer) error
- SayHelloServerStream(*HelloRequest, Greeter_SayHelloServerStreamServer) error
-}
-
-// UnimplementedGreeterServer can be embedded to have forward compatible implementations.
-type UnimplementedGreeterServer struct {
-}
-
-func (*UnimplementedGreeterServer) SayHelloTwoSidesStream(srv Greeter_SayHelloTwoSidesStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method SayHelloTwoSidesStream not implemented")
-}
-func (*UnimplementedGreeterServer) SayHelloClientStream(srv Greeter_SayHelloClientStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method SayHelloClientStream not implemented")
-}
-func (*UnimplementedGreeterServer) SayHelloServerStream(req *HelloRequest, srv Greeter_SayHelloServerStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method SayHelloServerStream not implemented")
-}
-
-func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
- s.RegisterService(&_Greeter_serviceDesc, srv)
-}
-
-func _Greeter_SayHelloTwoSidesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(GreeterServer).SayHelloTwoSidesStream(&greeterSayHelloTwoSidesStreamServer{stream})
-}
-
-type Greeter_SayHelloTwoSidesStreamServer interface {
- Send(*HelloReply) error
- Recv() (*HelloRequest, error)
- grpc.ServerStream
-}
-
-type greeterSayHelloTwoSidesStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *greeterSayHelloTwoSidesStreamServer) Send(m *HelloReply) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloTwoSidesStreamServer) Recv() (*HelloRequest, error) {
- m := new(HelloRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func _Greeter_SayHelloClientStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(GreeterServer).SayHelloClientStream(&greeterSayHelloClientStreamServer{stream})
-}
-
-type Greeter_SayHelloClientStreamServer interface {
- SendAndClose(*HelloReply) error
- Recv() (*HelloRequest, error)
- grpc.ServerStream
-}
-
-type greeterSayHelloClientStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *greeterSayHelloClientStreamServer) SendAndClose(m *HelloReply) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloClientStreamServer) Recv() (*HelloRequest, error) {
- m := new(HelloRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func _Greeter_SayHelloServerStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(HelloRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(GreeterServer).SayHelloServerStream(m, &greeterSayHelloServerStreamServer{stream})
-}
-
-type Greeter_SayHelloServerStreamServer interface {
- Send(*HelloReply) error
- grpc.ServerStream
-}
-
-type greeterSayHelloServerStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *greeterSayHelloServerStreamServer) Send(m *HelloReply) error {
- return x.ServerStream.SendMsg(m)
-}
-
-var _Greeter_serviceDesc = grpc.ServiceDesc{
- ServiceName: "main.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "SayHelloTwoSidesStream",
- Handler: _Greeter_SayHelloTwoSidesStream_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloClientStream",
- Handler: _Greeter_SayHelloClientStream_Handler,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloServerStream",
- Handler: _Greeter_SayHelloServerStream_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "helloworld.proto",
-}
-
-// GreeterClientImpl is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClientImpl struct {
- // Sends a greeting
- SayHelloTwoSidesStream func(ctx context.Context) (Greeter_SayHelloTwoSidesStreamClient, error)
- SayHelloClientStream func(ctx context.Context) (Greeter_SayHelloClientStreamClient, error)
- SayHelloServerStream func(ctx context.Context, in *HelloRequest) (Greeter_SayHelloServerStreamClient, error)
-}
-
-func (c *GreeterClientImpl) Reference() string {
- return "greeterImpl"
-}
-
-func (c *GreeterClientImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient {
- return NewGreeterClient(cc)
-}
-
-type GreeterProviderBase struct {
- proxyImpl protocol.Invoker
-}
-
-func (s *GreeterProviderBase) SetProxyImpl(impl protocol.Invoker) {
- s.proxyImpl = impl
-}
-
-func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
- return s.proxyImpl
-}
-
-func (c *GreeterProviderBase) Reference() string {
- return "greeterImpl"
-}
-
-func _DUBBO_Greeter_SayHelloTwoSidesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- _, ok := srv.(dgrpc.DubboGrpcService)
- invo := invocation.NewRPCInvocation("SayHelloTwoSidesStream", nil, nil)
- if !ok {
- fmt.Println(invo)
- }
- return srv.(GreeterServer).SayHelloTwoSidesStream(&greeterSayHelloTwoSidesStreamServer{stream})
-}
-
-func _DUBBO_Greeter_SayHelloClientStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- _, ok := srv.(dgrpc.DubboGrpcService)
- invo := invocation.NewRPCInvocation("SayHelloClientStream", nil, nil)
- if !ok {
- fmt.Println(invo)
- }
- return srv.(GreeterServer).SayHelloClientStream(&greeterSayHelloClientStreamServer{stream})
-}
-
-func _DUBBO_Greeter_SayHelloServerStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- _, ok := srv.(dgrpc.DubboGrpcService)
- invo := invocation.NewRPCInvocation("SayHelloServerStream", nil, nil)
- if !ok {
- fmt.Println(invo)
- }
- m := new(HelloRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(GreeterServer).SayHelloServerStream(m, &greeterSayHelloServerStreamServer{stream})
-}
-
-func (s *GreeterProviderBase) ServiceDesc() *grpc.ServiceDesc {
- return &grpc.ServiceDesc{
- ServiceName: "main.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "SayHelloTwoSidesStream",
- Handler: _DUBBO_Greeter_SayHelloTwoSidesStream_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloClientStream",
- Handler: _DUBBO_Greeter_SayHelloClientStream_Handler,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloServerStream",
- Handler: _DUBBO_Greeter_SayHelloServerStream_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "helloworld.proto",
- }
-}
diff --git a/rpc/grpc/stream/go-client/app/helloworld.proto b/rpc/grpc/stream/go-client/app/helloworld.proto
deleted file mode 100644
index 593bc4b..0000000
--- a/rpc/grpc/stream/go-client/app/helloworld.proto
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015 The gRPC Authors
-//
-// Licensed 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.
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "io.grpc.examples.helloworld";
-option java_outer_classname = "HelloWorldProto";
-option objc_class_prefix = "HLW";
-
-package main;
-
-// The greeting service definition.
-service Greeter {
- // Sends a greeting
- rpc SayHelloTwoSidesStream (stream HelloRequest) returns (stream HelloReply) {}
- rpc SayHelloClientStream(stream HelloRequest) returns (HelloReply) {}
- rpc SayHelloServerStream(HelloRequest) returns (stream HelloReply) {}
-}
-
-// The request message containing the user's name.
-message HelloRequest {
- string name = 1;
-}
-
-// The response message containing the greetings
-message HelloReply {
- string message = 1;
-}
diff --git a/rpc/grpc/stream/go-client/assembly/bin/load.sh b/rpc/grpc/stream/go-client/assembly/bin/load.sh
deleted file mode 100644
index ffa240b..0000000
--- a/rpc/grpc/stream/go-client/assembly/bin/load.sh
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-APP_NAME="APPLICATION_NAME"
-APP_ARGS=""
-SLEEP_INTERVAL=5
-MAX_LIFETIME=4000
-
-PROJECT_HOME=""
-OS_NAME=`uname`
-if [[ ${OS_NAME} != "Windows" ]]; then
- PROJECT_HOME=`pwd`
- PROJECT_HOME=${PROJECT_HOME}"/"
-else
- APP_NAME="APPLICATION_NAME.exe"
-fi
-
-export CONF_CONSUMER_FILE_PATH=${PROJECT_HOME}"TARGET_CONF_FILE"
-export APP_LOG_CONF_FILE=${PROJECT_HOME}"TARGET_LOG_CONF_FILE"
-# export GOTRACEBACK=system
-# export GODEBUG=gctrace=1
-
-usage() {
- echo "Usage: $0 start [conf suffix]"
- echo " $0 stop"
- echo " $0 term"
- echo " $0 restart"
- echo " $0 list"
- echo " $0 monitor"
- echo " $0 crontab"
- exit
-}
-
-start() {
- arg=$1
- if [ "$arg" = "" ];then
- echo "No registry type! Default client.yml!"
- else
- export CONF_CONSUMER_FILE_PATH=${CONF_CONSUMER_FILE_PATH//\.yml/\_$arg\.yml}
- fi
- if [ ! -f "${CONF_CONSUMER_FILE_PATH}" ];then
- echo $CONF_CONSUMER_FILE_PATH" is not existing!"
- return
- fi
- APP_LOG_PATH=${PROJECT_HOME}"logs/"
- mkdir -p ${APP_LOG_PATH}
- APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
- chmod u+x ${APP_BIN}
- # CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
- CMD="${APP_BIN}"
- eval ${CMD}
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- CUR=`date +%FT%T`
- if [ "${PID}" != "" ]; then
- for p in ${PID}
- do
- echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
- done
- fi
-}
-
-stop() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
- kill -2 ${ps}
- done
- fi
-}
-
-
-term() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
- kill -9 ${ps}
- done
- fi
-}
-
-list() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
- fi
-
- if [ "${PID}" != "" ]; then
- echo "list ${APP_NAME}"
-
- if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
- echo "index: user, pid, start, duration"
- else
- echo "index: PID, WINPID, UID, STIME, COMMAND"
- fi
- idx=0
- for ps in ${PID}
- do
- echo "${idx}: ${ps}"
- ((idx ++))
- done
- fi
-}
-
-monitor() {
- idx=0
- while true; do
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [[ "${PID}" == "" ]]; then
- start
- idx=0
- fi
-
- ((LIFE=idx*${SLEEP_INTERVAL}))
- echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
- ((idx ++))
- sleep ${SLEEP_INTERVAL}
- done
-}
-
-crontab() {
- idx=0
- while true; do
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [[ "${PID}" == "" ]]; then
- start
- idx=0
- fi
-
- ((LIFE=idx*${SLEEP_INTERVAL}))
- echo "${APP_NAME} ( pid = " ${PID} ") has been working in normal state for " $LIFE " seconds."
- ((idx ++))
- sleep ${SLEEP_INTERVAL}
- if [[ ${LIFE} -gt ${MAX_LIFETIME} ]]; then
- kill -9 ${PID}
- fi
- done
-}
-
-opt=$1
-case C"$opt" in
- Cstart)
- start $2
- ;;
- Cstop)
- stop
- ;;
- Cterm)
- term
- ;;
- Crestart)
- term
- start $2
- ;;
- Clist)
- list
- ;;
- Cmonitor)
- monitor
- ;;
- Ccrontab)
- crontab
- ;;
- C*)
- usage
- ;;
-esac
-
diff --git a/rpc/grpc/stream/go-client/assembly/common/app.properties b/rpc/grpc/stream/go-client/assembly/common/app.properties
deleted file mode 100644
index e10868f..0000000
--- a/rpc/grpc/stream/go-client/assembly/common/app.properties
+++ /dev/null
@@ -1,23 +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.
-
-
-export TARGET_EXEC_NAME="user_info_client"
-# BUILD_PACKAGE="dubbogo-examples/user-info/client/app"
-export BUILD_PACKAGE="app"
-
-export TARGET_CONF_FILE="conf/client.yml"
-export TARGET_LOG_CONF_FILE="conf/log.yml"
diff --git a/rpc/grpc/stream/go-client/assembly/common/build.sh b/rpc/grpc/stream/go-client/assembly/common/build.sh
deleted file mode 100644
index d38f889..0000000
--- a/rpc/grpc/stream/go-client/assembly/common/build.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-rm -rf target/
-
-PROJECT_HOME=`pwd`
-TARGET_FOLDER=${PROJECT_HOME}/target/${GOOS}
-
-TARGET_SBIN_NAME=${TARGET_EXEC_NAME}
-version=`cat app/version.go | grep Version | grep -v "Apache" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}'`
-if [[ ${GOOS} == "windows" ]]; then
- TARGET_SBIN_NAME=${TARGET_SBIN_NAME}.exe
-fi
-TARGET_NAME=${TARGET_FOLDER}/${TARGET_SBIN_NAME}
-if [[ $PROFILE == "dev" || $PROFILE == "test" ]]; then
- # GFLAGS=-gcflags "-N -l" -race -x -v # -x会把go build的详细过程输出
- # GFLAGS=-gcflags "-N -l" -race -v
- # GFLAGS="-gcflags \"-N -l\" -v"
- cd ${BUILD_PACKAGE} && GOOS=$GOOS GOARCH=$GOARCH GO111MODULE=on go build -gcflags "-N -l" -x -v -i -o ${TARGET_NAME} && cd -
-else
- # -s去掉符号表(然后panic时候的stack trace就没有任何文件名/行号信息了,这个等价于普通C/C++程序被strip的效果),
- # -w去掉DWARF调试信息,得到的程序就不能用gdb调试了。-s和-w也可以分开使用,一般来说如果不打算用gdb调试,
- # -w基本没啥损失。-s的损失就有点大了。
- cd ${BUILD_PACKAGE} && GOOS=$GOOS GOARCH=$GOARCH GO111MODULE=on go build -ldflags "-w" -x -v -i -o ${TARGET_NAME} && cd -
-fi
-
-TAR_NAME=${TARGET_EXEC_NAME}-${version}-`date "+%Y%m%d-%H%M"`-${PROFILE}
-
-mkdir -p ${TARGET_FOLDER}/${TAR_NAME}
-
-SBIN_DIR=${TARGET_FOLDER}/${TAR_NAME}/sbin
-BIN_DIR=${TARGET_FOLDER}/${TAR_NAME}
-CONF_DIR=${TARGET_FOLDER}/${TAR_NAME}/conf
-
-mkdir -p ${SBIN_DIR}
-mkdir -p ${CONF_DIR}
-
-mv ${TARGET_NAME} ${SBIN_DIR}
-cp -r assembly/bin ${BIN_DIR}
-cd ${BIN_DIR}/bin/ && mv load.sh load_${TARGET_EXEC_NAME}.sh && cd -
-
-platform=$(uname)
-# modify APPLICATION_NAME
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-fi
-
-# modify TARGET_CONF_FILE
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-# modify TARGET_LOG_CONF_FILE
-if [ ${platform} == "Darwin" ]; then
- sed -i "" "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-cp -r profiles/${PROFILE}/* ${CONF_DIR}
-
-cd ${TARGET_FOLDER}
-
-tar czf ${TAR_NAME}.tar.gz ${TAR_NAME}/*
-
diff --git a/rpc/grpc/stream/go-client/assembly/linux/dev.sh b/rpc/grpc/stream/go-client/assembly/linux/dev.sh
deleted file mode 100644
index eada737..0000000
--- a/rpc/grpc/stream/go-client/assembly/linux/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="dev"
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/linux/release.sh b/rpc/grpc/stream/go-client/assembly/linux/release.sh
deleted file mode 100644
index 10eb3d7..0000000
--- a/rpc/grpc/stream/go-client/assembly/linux/release.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/linux/test.sh b/rpc/grpc/stream/go-client/assembly/linux/test.sh
deleted file mode 100644
index 78b650c..0000000
--- a/rpc/grpc/stream/go-client/assembly/linux/test.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/mac/dev.sh b/rpc/grpc/stream/go-client/assembly/mac/dev.sh
deleted file mode 100644
index c828476..0000000
--- a/rpc/grpc/stream/go-client/assembly/mac/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="dev"
-
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/mac/release.sh b/rpc/grpc/stream/go-client/assembly/mac/release.sh
deleted file mode 100644
index 91c2dfe..0000000
--- a/rpc/grpc/stream/go-client/assembly/mac/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/mac/test.sh b/rpc/grpc/stream/go-client/assembly/mac/test.sh
deleted file mode 100644
index a7853f5..0000000
--- a/rpc/grpc/stream/go-client/assembly/mac/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/windows/dev.sh b/rpc/grpc/stream/go-client/assembly/windows/dev.sh
deleted file mode 100644
index 10a3866..0000000
--- a/rpc/grpc/stream/go-client/assembly/windows/dev.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-export PROFILE="dev"
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/windows/release.sh b/rpc/grpc/stream/go-client/assembly/windows/release.sh
deleted file mode 100644
index 21af573..0000000
--- a/rpc/grpc/stream/go-client/assembly/windows/release.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-export PROFILE="release"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/assembly/windows/test.sh b/rpc/grpc/stream/go-client/assembly/windows/test.sh
deleted file mode 100644
index 2104da8..0000000
--- a/rpc/grpc/stream/go-client/assembly/windows/test.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-export PROFILE="test"
-export PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
- . ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
- sh ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-client/profiles/dev/client.yml b/rpc/grpc/stream/go-client/profiles/dev/client.yml
deleted file mode 100644
index ae2a7cd..0000000
--- a/rpc/grpc/stream/go-client/profiles/dev/client.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "zk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-
-references:
- "greeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "zk"
- protocol : "grpc"
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods :
- - name: "SayHello"
- retries: 3
-
-
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
\ No newline at end of file
diff --git a/rpc/grpc/stream/go-client/profiles/dev/log.yml b/rpc/grpc/stream/go-client/profiles/dev/log.yml
deleted file mode 100644
index 59fa427..0000000
--- a/rpc/grpc/stream/go-client/profiles/dev/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "debug"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/stream/go-client/profiles/release/log.yml b/rpc/grpc/stream/go-client/profiles/release/log.yml
deleted file mode 100644
index e0514be..0000000
--- a/rpc/grpc/stream/go-client/profiles/release/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "warn"
-development: true
-disableCaller: true
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/stream/go-client/profiles/test/client.yml b/rpc/grpc/stream/go-client/profiles/test/client.yml
deleted file mode 100644
index 48d158b..0000000
--- a/rpc/grpc/stream/go-client/profiles/test/client.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-# dubbo client yaml configure file
-
-
-check: true
-# client
-request_timeout : "3s"
-# connect timeout
-connect_timeout : "3s"
-
-config_center:
- protocol: "zookeeper"
- address: "127.0.0.1:2181"
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
- username: ""
- password: ""
-
-references:
- "greeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- cluster: "failover"
- methods :
- - name: "SayHello"
- retries: 3
-
-
-protocol_conf:
- grpc:
- reconnect_interval: 0
- connection_number: 2
- heartbeat_period: "5s"
- session_timeout: "20s"
- pool_size: 64
- pool_ttl: 600
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 10240
- session_name: "client"
\ No newline at end of file
diff --git a/rpc/grpc/stream/go-client/profiles/test/log.yml b/rpc/grpc/stream/go-client/profiles/test/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/rpc/grpc/stream/go-client/profiles/test/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/stream/go-server/app/greeter.go b/rpc/grpc/stream/go-server/app/greeter.go
deleted file mode 100644
index 0c2c9d6..0000000
--- a/rpc/grpc/stream/go-server/app/greeter.go
+++ /dev/null
@@ -1,99 +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 (
- "fmt"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/common/logger"
- "dubbo.apache.org/dubbo-go/v3/config"
-)
-
-func init() {
- config.SetProviderService(NewGreeterProvider())
-}
-
-type GreeterProvider struct {
- *GreeterProviderBase
-}
-
-func NewGreeterProvider() *GreeterProvider {
- return &GreeterProvider{
- GreeterProviderBase: &GreeterProviderBase{},
- }
-}
-
-func (g *GreeterProvider) SayHelloTwoSidesStream(server Greeter_SayHelloTwoSidesStreamServer) error {
- req := &HelloRequest{}
- fmt.Printf("in SayHelloTwoSidesStream func\n")
- if err := server.RecvMsg(req); err != nil {
- fmt.Printf("server.RecvMsg err = %s", err.Error())
- return err
- }
- fmt.Printf("req1: %v\n", *req)
- if err := server.RecvMsg(req); err != nil {
- logger.Errorf("server.RecvMsg err = %s", err.Error())
- return err
- }
- fmt.Printf("req2: %v\n", *req)
- if err := server.Send(&HelloReply{Message: "reply1"}); err != nil {
- logger.Errorf("server.Send err = %s", err.Error())
- return err
- }
- if err := server.Send(&HelloReply{Message: "reply2"}); err != nil {
- logger.Errorf("server.Send err = %s", err.Error())
- return err
- }
- return nil
-}
-
-func (g *GreeterProvider) SayHelloClientStream(server Greeter_SayHelloClientStreamServer) error {
- req := &HelloRequest{}
- fmt.Printf("in SayHelloClientStream func\n")
- if err := server.RecvMsg(req); err != nil {
- fmt.Printf("server.RecvMsg err = %s", err.Error())
- return err
- }
- fmt.Printf("req1: %v\n", *req)
- if err := server.RecvMsg(req); err != nil {
- logger.Errorf("server.RecvMsg err = %s", err.Error())
- return err
- }
- fmt.Printf("req2: %v\n", *req)
- if err := server.SendMsg(&HelloReply{Message: "unary reply"}); err != nil {
- logger.Errorf("server.Send err = %s", err.Error())
- return err
- }
- return nil
-}
-
-func (g *GreeterProvider) SayHelloServerStream(req *HelloRequest, server Greeter_SayHelloServerStreamServer) error {
- fmt.Println("in SayHelloServerStream func")
- fmt.Printf("unary req: %v\n", *req)
- if err := server.Send(&HelloReply{Message: "reply1"}); err != nil {
- logger.Errorf("server.Send err = %s", err.Error())
- return err
- }
- if err := server.Send(&HelloReply{Message: "reply2"}); err != nil {
- logger.Errorf("server.Send err = %s", err.Error())
- return err
- }
- return nil
-}
diff --git a/rpc/grpc/stream/go-server/app/helloworld.pb.go b/rpc/grpc/stream/go-server/app/helloworld.pb.go
deleted file mode 100644
index bc59eb1..0000000
--- a/rpc/grpc/stream/go-server/app/helloworld.pb.go
+++ /dev/null
@@ -1,477 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: helloworld.proto
-
-package main
-
-import (
- context "context"
- fmt "fmt"
- math "math"
-)
-
-import (
- "dubbo.apache.org/dubbo-go/v3/protocol"
- dgrpc "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
-
- proto "github.com/golang/protobuf/proto"
-
- grpc "google.golang.org/grpc"
- codes "google.golang.org/grpc/codes"
- status "google.golang.org/grpc/status"
-)
-
-var _ = proto.Marshal
-var _ = fmt.Errorf
-var _ = math.Inf
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the proto package it is being compiled against.
-// A compilation error at this line likely means your copy of the
-// proto package needs to be updated.
-const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
-
-// The request message containing the user's name.
-type HelloRequest struct {
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloRequest) Reset() { *m = HelloRequest{} }
-func (m *HelloRequest) String() string { return proto.CompactTextString(m) }
-func (*HelloRequest) ProtoMessage() {}
-func (*HelloRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{0}
-}
-
-func (m *HelloRequest) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloRequest.Unmarshal(m, b)
-}
-func (m *HelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloRequest.Marshal(b, m, deterministic)
-}
-func (m *HelloRequest) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloRequest.Merge(m, src)
-}
-func (m *HelloRequest) XXX_Size() int {
- return xxx_messageInfo_HelloRequest.Size(m)
-}
-func (m *HelloRequest) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloRequest proto.InternalMessageInfo
-
-func (m *HelloRequest) GetName() string {
- if m != nil {
- return m.Name
- }
- return ""
-}
-
-// The response message containing the greetings
-type HelloReply struct {
- Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
- XXX_NoUnkeyedLiteral struct{} `json:"-"`
- XXX_unrecognized []byte `json:"-"`
- XXX_sizecache int32 `json:"-"`
-}
-
-func (m *HelloReply) Reset() { *m = HelloReply{} }
-func (m *HelloReply) String() string { return proto.CompactTextString(m) }
-func (*HelloReply) ProtoMessage() {}
-func (*HelloReply) Descriptor() ([]byte, []int) {
- return fileDescriptor_17b8c58d586b62f2, []int{1}
-}
-
-func (m *HelloReply) XXX_Unmarshal(b []byte) error {
- return xxx_messageInfo_HelloReply.Unmarshal(m, b)
-}
-func (m *HelloReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
- return xxx_messageInfo_HelloReply.Marshal(b, m, deterministic)
-}
-func (m *HelloReply) XXX_Merge(src proto.Message) {
- xxx_messageInfo_HelloReply.Merge(m, src)
-}
-func (m *HelloReply) XXX_Size() int {
- return xxx_messageInfo_HelloReply.Size(m)
-}
-func (m *HelloReply) XXX_DiscardUnknown() {
- xxx_messageInfo_HelloReply.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_HelloReply proto.InternalMessageInfo
-
-func (m *HelloReply) GetMessage() string {
- if m != nil {
- return m.Message
- }
- return ""
-}
-
-func init() {
- proto.RegisterType((*HelloRequest)(nil), "main.HelloRequest")
- proto.RegisterType((*HelloReply)(nil), "main.HelloReply")
-}
-
-func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_17b8c58d586b62f2) }
-
-var fileDescriptor_17b8c58d586b62f2 = []byte{
- // 232 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0x48, 0xcd, 0xc9,
- 0xc9, 0x2f, 0xcf, 0x2f, 0xca, 0x49, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xc9, 0x4d,
- 0xcc, 0xcc, 0x53, 0x52, 0xe2, 0xe2, 0xf1, 0x00, 0xc9, 0x04, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97,
- 0x08, 0x09, 0x71, 0xb1, 0xe4, 0x25, 0xe6, 0xa6, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81,
- 0xd9, 0x4a, 0x6a, 0x5c, 0x5c, 0x50, 0x35, 0x05, 0x39, 0x95, 0x42, 0x12, 0x5c, 0xec, 0xb9, 0xa9,
- 0xc5, 0xc5, 0x89, 0xe9, 0x30, 0x45, 0x30, 0xae, 0xd1, 0x65, 0x46, 0x2e, 0x76, 0xf7, 0xa2, 0xd4,
- 0xd4, 0x92, 0xd4, 0x22, 0x21, 0x17, 0x2e, 0xb1, 0xe0, 0xc4, 0x4a, 0xb0, 0xb6, 0x90, 0xf2, 0xfc,
- 0xe0, 0xcc, 0x94, 0xd4, 0xe2, 0xe0, 0x92, 0xa2, 0xd4, 0xc4, 0x5c, 0x21, 0x21, 0x3d, 0x90, 0xc5,
- 0x7a, 0xc8, 0xb6, 0x4a, 0x09, 0xa0, 0x88, 0x15, 0xe4, 0x54, 0x2a, 0x31, 0x68, 0x30, 0x1a, 0x30,
- 0x0a, 0x39, 0x70, 0x89, 0xc0, 0x4c, 0x71, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0x21, 0xd5, 0x0c, 0x64,
- 0x13, 0x82, 0x53, 0x8b, 0xca, 0x52, 0x8b, 0x48, 0x33, 0xc1, 0x80, 0xd1, 0xc9, 0x8c, 0x4b, 0x3a,
- 0x33, 0x5f, 0x2f, 0xbd, 0xa8, 0x20, 0x59, 0x2f, 0xb5, 0x22, 0x31, 0xb7, 0x20, 0x27, 0xb5, 0x58,
- 0x0f, 0x11, 0x98, 0x4e, 0xfc, 0x60, 0xe5, 0xe1, 0x20, 0x76, 0x00, 0x28, 0x5c, 0x03, 0x18, 0x17,
- 0x31, 0x31, 0x7b, 0xf8, 0x84, 0x27, 0xb1, 0x81, 0x83, 0xd9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff,
- 0xe7, 0x0c, 0xb8, 0x0a, 0x7a, 0x01, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// GreeterClient is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClient interface {
- // Sends a greeting
- SayHelloTwoSidesStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloTwoSidesStreamClient, error)
- SayHelloClientStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloClientStreamClient, error)
- SayHelloServerStream(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Greeter_SayHelloServerStreamClient, error)
-}
-
-type greeterClient struct {
- cc grpc.ClientConnInterface
-}
-
-func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient {
- return &greeterClient{cc}
-}
-
-func (c *greeterClient) SayHelloTwoSidesStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloTwoSidesStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Greeter_serviceDesc.Streams[0], "/main.Greeter/SayHelloTwoSidesStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &greeterSayHelloTwoSidesStreamClient{stream}
- return x, nil
-}
-
-type Greeter_SayHelloTwoSidesStreamClient interface {
- Send(*HelloRequest) error
- Recv() (*HelloReply, error)
- grpc.ClientStream
-}
-
-type greeterSayHelloTwoSidesStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *greeterSayHelloTwoSidesStreamClient) Send(m *HelloRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloTwoSidesStreamClient) Recv() (*HelloReply, error) {
- m := new(HelloReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *greeterClient) SayHelloClientStream(ctx context.Context, opts ...grpc.CallOption) (Greeter_SayHelloClientStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Greeter_serviceDesc.Streams[1], "/main.Greeter/SayHelloClientStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &greeterSayHelloClientStreamClient{stream}
- return x, nil
-}
-
-type Greeter_SayHelloClientStreamClient interface {
- Send(*HelloRequest) error
- CloseAndRecv() (*HelloReply, error)
- grpc.ClientStream
-}
-
-type greeterSayHelloClientStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *greeterSayHelloClientStreamClient) Send(m *HelloRequest) error {
- return x.ClientStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloClientStreamClient) CloseAndRecv() (*HelloReply, error) {
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- m := new(HelloReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func (c *greeterClient) SayHelloServerStream(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (Greeter_SayHelloServerStreamClient, error) {
- stream, err := c.cc.NewStream(ctx, &_Greeter_serviceDesc.Streams[2], "/main.Greeter/SayHelloServerStream", opts...)
- if err != nil {
- return nil, err
- }
- x := &greeterSayHelloServerStreamClient{stream}
- if err := x.ClientStream.SendMsg(in); err != nil {
- return nil, err
- }
- if err := x.ClientStream.CloseSend(); err != nil {
- return nil, err
- }
- return x, nil
-}
-
-type Greeter_SayHelloServerStreamClient interface {
- Recv() (*HelloReply, error)
- grpc.ClientStream
-}
-
-type greeterSayHelloServerStreamClient struct {
- grpc.ClientStream
-}
-
-func (x *greeterSayHelloServerStreamClient) Recv() (*HelloReply, error) {
- m := new(HelloReply)
- if err := x.ClientStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-// GreeterServer is the server API for Greeter service.
-type GreeterServer interface {
- // Sends a greeting
- SayHelloTwoSidesStream(Greeter_SayHelloTwoSidesStreamServer) error
- SayHelloClientStream(Greeter_SayHelloClientStreamServer) error
- SayHelloServerStream(*HelloRequest, Greeter_SayHelloServerStreamServer) error
-}
-
-// UnimplementedGreeterServer can be embedded to have forward compatible implementations.
-type UnimplementedGreeterServer struct {
-}
-
-func (*UnimplementedGreeterServer) SayHelloTwoSidesStream(srv Greeter_SayHelloTwoSidesStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method SayHelloTwoSidesStream not implemented")
-}
-func (*UnimplementedGreeterServer) SayHelloClientStream(srv Greeter_SayHelloClientStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method SayHelloClientStream not implemented")
-}
-func (*UnimplementedGreeterServer) SayHelloServerStream(req *HelloRequest, srv Greeter_SayHelloServerStreamServer) error {
- return status.Errorf(codes.Unimplemented, "method SayHelloServerStream not implemented")
-}
-
-func RegisterGreeterServer(s *grpc.Server, srv GreeterServer) {
- s.RegisterService(&_Greeter_serviceDesc, srv)
-}
-
-func _Greeter_SayHelloTwoSidesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(GreeterServer).SayHelloTwoSidesStream(&greeterSayHelloTwoSidesStreamServer{stream})
-}
-
-type Greeter_SayHelloTwoSidesStreamServer interface {
- Send(*HelloReply) error
- Recv() (*HelloRequest, error)
- grpc.ServerStream
-}
-
-type greeterSayHelloTwoSidesStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *greeterSayHelloTwoSidesStreamServer) Send(m *HelloReply) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloTwoSidesStreamServer) Recv() (*HelloRequest, error) {
- m := new(HelloRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func _Greeter_SayHelloClientStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(GreeterServer).SayHelloClientStream(&greeterSayHelloClientStreamServer{stream})
-}
-
-type Greeter_SayHelloClientStreamServer interface {
- SendAndClose(*HelloReply) error
- Recv() (*HelloRequest, error)
- grpc.ServerStream
-}
-
-type greeterSayHelloClientStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *greeterSayHelloClientStreamServer) SendAndClose(m *HelloReply) error {
- return x.ServerStream.SendMsg(m)
-}
-
-func (x *greeterSayHelloClientStreamServer) Recv() (*HelloRequest, error) {
- m := new(HelloRequest)
- if err := x.ServerStream.RecvMsg(m); err != nil {
- return nil, err
- }
- return m, nil
-}
-
-func _Greeter_SayHelloServerStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- m := new(HelloRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(GreeterServer).SayHelloServerStream(m, &greeterSayHelloServerStreamServer{stream})
-}
-
-type Greeter_SayHelloServerStreamServer interface {
- Send(*HelloReply) error
- grpc.ServerStream
-}
-
-type greeterSayHelloServerStreamServer struct {
- grpc.ServerStream
-}
-
-func (x *greeterSayHelloServerStreamServer) Send(m *HelloReply) error {
- return x.ServerStream.SendMsg(m)
-}
-
-var _Greeter_serviceDesc = grpc.ServiceDesc{
- ServiceName: "main.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "SayHelloTwoSidesStream",
- Handler: _Greeter_SayHelloTwoSidesStream_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloClientStream",
- Handler: _Greeter_SayHelloClientStream_Handler,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloServerStream",
- Handler: _Greeter_SayHelloServerStream_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "helloworld.proto",
-}
-
-// GreeterClientImpl is the client API for Greeter service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type GreeterClientImpl struct {
- // Sends a greeting
- SayHelloTwoSidesStream func(ctx context.Context) (Greeter_SayHelloTwoSidesStreamClient, error)
- SayHelloClientStream func(ctx context.Context) (Greeter_SayHelloClientStreamClient, error)
- SayHelloServerStream func(ctx context.Context, in *HelloRequest) (Greeter_SayHelloServerStreamClient, error)
-}
-
-func (c *GreeterClientImpl) Reference() string {
- return "greeterImpl"
-}
-
-func (c *GreeterClientImpl) GetDubboStub(cc *grpc.ClientConn) GreeterClient {
- return NewGreeterClient(cc)
-}
-
-type GreeterProviderBase struct {
- proxyImpl protocol.Invoker
-}
-
-func (s *GreeterProviderBase) SetProxyImpl(impl protocol.Invoker) {
- s.proxyImpl = impl
-}
-
-func (s *GreeterProviderBase) GetProxyImpl() protocol.Invoker {
- return s.proxyImpl
-}
-
-func (c *GreeterProviderBase) Reference() string {
- return "greeterImpl"
-}
-
-func _DUBBO_Greeter_SayHelloTwoSidesStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- _, ok := srv.(dgrpc.DubboGrpcService)
- invo := invocation.NewRPCInvocation("SayHelloTwoSidesStream", nil, nil)
- if !ok {
- fmt.Println(invo)
- }
- return srv.(GreeterServer).SayHelloTwoSidesStream(&greeterSayHelloTwoSidesStreamServer{stream})
-}
-
-func _DUBBO_Greeter_SayHelloClientStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- _, ok := srv.(dgrpc.DubboGrpcService)
- invo := invocation.NewRPCInvocation("SayHelloClientStream", nil, nil)
- if !ok {
- fmt.Println(invo)
- }
- return srv.(GreeterServer).SayHelloClientStream(&greeterSayHelloClientStreamServer{stream})
-}
-
-func _DUBBO_Greeter_SayHelloServerStream_Handler(srv interface{}, stream grpc.ServerStream) error {
- _, ok := srv.(dgrpc.DubboGrpcService)
- invo := invocation.NewRPCInvocation("SayHelloServerStream", nil, nil)
- if !ok {
- fmt.Println(invo)
- }
- m := new(HelloRequest)
- if err := stream.RecvMsg(m); err != nil {
- return err
- }
- return srv.(GreeterServer).SayHelloServerStream(m, &greeterSayHelloServerStreamServer{stream})
-}
-
-func (s *GreeterProviderBase) ServiceDesc() *grpc.ServiceDesc {
- return &grpc.ServiceDesc{
- ServiceName: "main.Greeter",
- HandlerType: (*GreeterServer)(nil),
- Methods: []grpc.MethodDesc{},
- Streams: []grpc.StreamDesc{
- {
- StreamName: "SayHelloTwoSidesStream",
- Handler: _DUBBO_Greeter_SayHelloTwoSidesStream_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloClientStream",
- Handler: _DUBBO_Greeter_SayHelloClientStream_Handler,
- ClientStreams: true,
- },
- {
- StreamName: "SayHelloServerStream",
- Handler: _DUBBO_Greeter_SayHelloServerStream_Handler,
- ServerStreams: true,
- },
- },
- Metadata: "helloworld.proto",
- }
-}
diff --git a/rpc/grpc/stream/go-server/app/helloworld.proto b/rpc/grpc/stream/go-server/app/helloworld.proto
deleted file mode 100644
index 593bc4b..0000000
--- a/rpc/grpc/stream/go-server/app/helloworld.proto
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015 The gRPC Authors
-//
-// Licensed 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.
-syntax = "proto3";
-
-option java_multiple_files = true;
-option java_package = "io.grpc.examples.helloworld";
-option java_outer_classname = "HelloWorldProto";
-option objc_class_prefix = "HLW";
-
-package main;
-
-// The greeting service definition.
-service Greeter {
- // Sends a greeting
- rpc SayHelloTwoSidesStream (stream HelloRequest) returns (stream HelloReply) {}
- rpc SayHelloClientStream(stream HelloRequest) returns (HelloReply) {}
- rpc SayHelloServerStream(HelloRequest) returns (stream HelloReply) {}
-}
-
-// The request message containing the user's name.
-message HelloRequest {
- string name = 1;
-}
-
-// The response message containing the greetings
-message HelloReply {
- string message = 1;
-}
diff --git a/rpc/grpc/stream/go-server/app/server.go b/rpc/grpc/stream/go-server/app/server.go
deleted file mode 100644
index 31128e6..0000000
--- a/rpc/grpc/stream/go-server/app/server.go
+++ /dev/null
@@ -1,71 +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 (
- "fmt"
- "os"
- "os/signal"
- "syscall"
- "time"
-)
-
-import (
- _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster_impl"
- _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance"
- "dubbo.apache.org/dubbo-go/v3/common/logger"
- _ "dubbo.apache.org/dubbo-go/v3/common/proxy/proxy_factory"
- "dubbo.apache.org/dubbo-go/v3/config"
- _ "dubbo.apache.org/dubbo-go/v3/filter/filter_impl"
- _ "dubbo.apache.org/dubbo-go/v3/protocol/grpc"
- _ "dubbo.apache.org/dubbo-go/v3/registry/protocol"
- _ "dubbo.apache.org/dubbo-go/v3/registry/zookeeper"
-)
-
-var (
- survivalTimeout = int(3 * time.Second)
-)
-
-// need to setup environment variable "CONF_PROVIDER_FILE_PATH" to "conf/server.yml" before run
-func main() {
- config.Load()
- initSignal()
-}
-
-func initSignal() {
- signals := make(chan os.Signal, 1)
- // It is not possible to block SIGKILL or syscall.SIGSTOP
- signal.Notify(signals, os.Interrupt, os.Kill, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
- for {
- sig := <-signals
- logger.Infof("get signal %s", sig.String())
- switch sig {
- case syscall.SIGHUP:
- // reload()
- default:
- time.AfterFunc(time.Duration(survivalTimeout), func() {
- logger.Warnf("app exit now by force...")
- os.Exit(1)
- })
-
- // The program exits normally or timeout forcibly exits.
- fmt.Println("provider app exit now...")
- return
- }
- }
-}
diff --git a/rpc/grpc/stream/go-server/app/version.go b/rpc/grpc/stream/go-server/app/version.go
deleted file mode 100644
index ae51f45..0000000
--- a/rpc/grpc/stream/go-server/app/version.go
+++ /dev/null
@@ -1,22 +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
-
-var (
- Version = "2.7.5"
-)
diff --git a/rpc/grpc/stream/go-server/assembly/bin/load.sh b/rpc/grpc/stream/go-server/assembly/bin/load.sh
deleted file mode 100644
index 90077c2..0000000
--- a/rpc/grpc/stream/go-server/assembly/bin/load.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-APP_NAME="APPLICATION_NAME"
-APP_ARGS=""
-
-
-PROJECT_HOME=""
-OS_NAME=`uname`
-if [[ ${OS_NAME} != "Windows" ]]; then
- PROJECT_HOME=`pwd`
- PROJECT_HOME=${PROJECT_HOME}"/"
-fi
-
-export CONF_PROVIDER_FILE_PATH=${PROJECT_HOME}"TARGET_CONF_FILE"
-export APP_LOG_CONF_FILE=${PROJECT_HOME}"TARGET_LOG_CONF_FILE"
-
-usage() {
- echo "Usage: $0 start [conf suffix]"
- echo " $0 stop"
- echo " $0 term"
- echo " $0 restart"
- echo " $0 list"
- echo " $0 monitor"
- echo " $0 crontab"
- exit
-}
-
-start() {
- arg=$1
- if [ "$arg" = "" ];then
- echo "No registry type! Default server.yml!"
- else
- export CONF_PROVIDER_FILE_PATH=${CONF_PROVIDER_FILE_PATH//\.yml/\_$arg\.yml}
- fi
- if [ ! -f "${CONF_PROVIDER_FILE_PATH}" ];then
- echo $CONF_PROVIDER_FILE_PATH" is not existing!"
- return
- fi
- APP_LOG_PATH="${PROJECT_HOME}logs/"
- mkdir -p ${APP_LOG_PATH}
- APP_BIN=${PROJECT_HOME}sbin/${APP_NAME}
- chmod u+x ${APP_BIN}
- # CMD="nohup ${APP_BIN} ${APP_ARGS} >>${APP_NAME}.nohup.out 2>&1 &"
- CMD="${APP_BIN}"
- eval ${CMD}
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- CUR=`date +%FT%T`
- if [ "${PID}" != "" ]; then
- for p in ${PID}
- do
- echo "start ${APP_NAME} ( pid =" ${p} ") at " ${CUR}
- done
- fi
-}
-
-stop() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -SIGINT ${APP_NAME} ( pid =" ${ps} ")"
- kill -2 ${ps}
- done
- fi
-}
-
-
-term() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $2}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{print $1}'`
- fi
- if [ "${PID}" != "" ];
- then
- for ps in ${PID}
- do
- echo "kill -9 ${APP_NAME} ( pid =" ${ps} ")"
- kill -9 ${ps}
- done
- fi
-}
-
-list() {
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s\n", $1, $2, $9, $10)}'`
- if [[ ${OS_NAME} != "Linux" && ${OS_NAME} != "Darwin" ]]; then
- PID=`ps aux | grep -w ${APP_NAME} | grep -v grep | awk '{printf("%s,%s,%s,%s,%s\n", $1, $4, $6, $7, $8)}'`
- fi
-
- if [ "${PID}" != "" ]; then
- echo "list ${APP_NAME}"
-
- if [[ ${OS_NAME} == "Linux" || ${OS_NAME} == "Darwin" ]]; then
- echo "index: user, pid, start, duration"
- else
- echo "index: PID, WINPID, UID, STIME, COMMAND"
- fi
- idx=0
- for ps in ${PID}
- do
- echo "${idx}: ${ps}"
- ((idx ++))
- done
- fi
-}
-
-opt=$1
-case C"$opt" in
- Cstart)
- start $2
- ;;
- Cstop)
- stop
- ;;
- Cterm)
- term
- ;;
- Crestart)
- term
- start $2
- ;;
- Clist)
- list
- ;;
- C*)
- usage
- ;;
-esac
-
diff --git a/rpc/grpc/stream/go-server/assembly/common/app.properties b/rpc/grpc/stream/go-server/assembly/common/app.properties
deleted file mode 100644
index 1f0827e..0000000
--- a/rpc/grpc/stream/go-server/assembly/common/app.properties
+++ /dev/null
@@ -1,23 +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.
-
-
-TARGET_EXEC_NAME="user_info_server"
-# BUILD_PACKAGE="dubbogo-examples/user-info/server/app"
-BUILD_PACKAGE="app"
-
-TARGET_CONF_FILE="conf/server.yml"
-TARGET_LOG_CONF_FILE="conf/log.yml"
diff --git a/rpc/grpc/stream/go-server/assembly/common/build.sh b/rpc/grpc/stream/go-server/assembly/common/build.sh
deleted file mode 100644
index d90d026..0000000
--- a/rpc/grpc/stream/go-server/assembly/common/build.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-rm -rf target/
-
-PROJECT_HOME=`pwd`
-TARGET_FOLDER=${PROJECT_HOME}/target/${GOOS}
-
-TARGET_SBIN_NAME=${TARGET_EXEC_NAME}
-version=`cat app/version.go | grep Version | grep -v "Apache" | awk -F '=' '{print $2}' | awk -F '"' '{print $2}'`
-if [[ ${GOOS} == "windows" ]]; then
- TARGET_SBIN_NAME=${TARGET_SBIN_NAME}.exe
-fi
-TARGET_NAME=${TARGET_FOLDER}/${TARGET_SBIN_NAME}
-if [[ $PROFILE = "test" ]]; then
- # GFLAGS=-gcflags "-N -l" -race -x -v # -x会把go build的详细过程输出
- # GFLAGS=-gcflags "-N -l" -race -v
- # GFLAGS="-gcflags \"-N -l\" -v"
- cd ${BUILD_PACKAGE} && GO111MODULE=on go build -gcflags "-N -l" -x -v -i -o ${TARGET_NAME} && cd -
-else
- # -s去掉符号表(然后panic时候的stack trace就没有任何文件名/行号信息了,这个等价于普通C/C++程序被strip的效果),
- # -w去掉DWARF调试信息,得到的程序就不能用gdb调试了。-s和-w也可以分开使用,一般来说如果不打算用gdb调试,
- # -w基本没啥损失。-s的损失就有点大了。
- cd ${BUILD_PACKAGE} && GO111MODULE=on go build -ldflags "-w" -x -v -i -o ${TARGET_NAME} && cd -
-fi
-
-TAR_NAME=${TARGET_EXEC_NAME}-${version}-`date "+%Y%m%d-%H%M"`-${PROFILE}
-
-mkdir -p ${TARGET_FOLDER}/${TAR_NAME}
-
-SBIN_DIR=${TARGET_FOLDER}/${TAR_NAME}/sbin
-BIN_DIR=${TARGET_FOLDER}/${TAR_NAME}
-CONF_DIR=${TARGET_FOLDER}/${TAR_NAME}/conf
-
-mkdir -p ${SBIN_DIR}
-mkdir -p ${CONF_DIR}
-
-mv ${TARGET_NAME} ${SBIN_DIR}
-cp -r assembly/bin ${BIN_DIR}
-# modify APPLICATION_NAME
-# OS=`uname`
-# if [[ $OS=="Darwin" ]]; then
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~APPLICATION_NAME~${TARGET_EXEC_NAME}~g" ${BIN_DIR}/bin/*
-fi
-# modify TARGET_CONF_FILE
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_CONF_FILE~${TARGET_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-# modify TARGET_LOG_CONF_FILE
-if [ "$(uname)" == "Darwin" ]; then
- sed -i "" "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-else
- sed -i "s~TARGET_LOG_CONF_FILE~${TARGET_LOG_CONF_FILE}~g" ${BIN_DIR}/bin/*
-fi
-
-cp -r profiles/${PROFILE}/* ${CONF_DIR}
-
-cd ${TARGET_FOLDER}
-
-tar czf ${TAR_NAME}.tar.gz ${TAR_NAME}/*
-
diff --git a/rpc/grpc/stream/go-server/assembly/linux/dev.sh b/rpc/grpc/stream/go-server/assembly/linux/dev.sh
deleted file mode 100644
index d830ac9..0000000
--- a/rpc/grpc/stream/go-server/assembly/linux/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/linux/release.sh b/rpc/grpc/stream/go-server/assembly/linux/release.sh
deleted file mode 100644
index 9930380..0000000
--- a/rpc/grpc/stream/go-server/assembly/linux/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/linux/test.sh b/rpc/grpc/stream/go-server/assembly/linux/test.sh
deleted file mode 100644
index 87144bb..0000000
--- a/rpc/grpc/stream/go-server/assembly/linux/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=linux
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/mac/dev.sh b/rpc/grpc/stream/go-server/assembly/mac/dev.sh
deleted file mode 100644
index 3a7659b..0000000
--- a/rpc/grpc/stream/go-server/assembly/mac/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/mac/release.sh b/rpc/grpc/stream/go-server/assembly/mac/release.sh
deleted file mode 100644
index 1c4bce4..0000000
--- a/rpc/grpc/stream/go-server/assembly/mac/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/mac/test.sh b/rpc/grpc/stream/go-server/assembly/mac/test.sh
deleted file mode 100644
index 69206e3..0000000
--- a/rpc/grpc/stream/go-server/assembly/mac/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-set -e
-
-export GOOS=darwin
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
-
diff --git a/rpc/grpc/stream/go-server/assembly/windows/dev.sh b/rpc/grpc/stream/go-server/assembly/windows/dev.sh
deleted file mode 100644
index 011fb41..0000000
--- a/rpc/grpc/stream/go-server/assembly/windows/dev.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=dev
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/windows/release.sh b/rpc/grpc/stream/go-server/assembly/windows/release.sh
deleted file mode 100644
index 679a26a..0000000
--- a/rpc/grpc/stream/go-server/assembly/windows/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=release
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/assembly/windows/test.sh b/rpc/grpc/stream/go-server/assembly/windows/test.sh
deleted file mode 100644
index 4a36de0..0000000
--- a/rpc/grpc/stream/go-server/assembly/windows/test.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env bash
-#
-# 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.
-
-
-
-set -e
-
-export GOOS=windows
-export GOARCH=amd64
-
-PROFILE=test
-
-PROJECT_HOME=`pwd`
-
-if [ -f "${PROJECT_HOME}/assembly/common/app.properties" ]; then
-. ${PROJECT_HOME}/assembly/common/app.properties
-fi
-
-
-if [ -f "${PROJECT_HOME}/assembly/common/build.sh" ]; then
-. ${PROJECT_HOME}/assembly/common/build.sh
-fi
diff --git a/rpc/grpc/stream/go-server/profiles/dev/log.yml b/rpc/grpc/stream/go-server/profiles/dev/log.yml
deleted file mode 100644
index 59fa427..0000000
--- a/rpc/grpc/stream/go-server/profiles/dev/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "debug"
-development: true
-disableCaller: false
-disableStacktrace: false
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/stream/go-server/profiles/dev/server.yml b/rpc/grpc/stream/go-server/profiles/dev/server.yml
deleted file mode 100644
index df37534..0000000
--- a/rpc/grpc/stream/go-server/profiles/dev/server.yml
+++ /dev/null
@@ -1,57 +0,0 @@
-# dubbo server yaml configure file
-
-
-# application config
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "zk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
-
-services:
- "greeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "zk"
- protocol : "grpc"
- # 相当于dubbo.xml中的interface
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/rpc/grpc/stream/go-server/profiles/release/log.yml b/rpc/grpc/stream/go-server/profiles/release/log.yml
deleted file mode 100644
index e0514be..0000000
--- a/rpc/grpc/stream/go-server/profiles/release/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "warn"
-development: true
-disableCaller: true
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/stream/go-server/profiles/release/server.yml b/rpc/grpc/stream/go-server/profiles/release/server.yml
deleted file mode 100644
index 8c9b2db..0000000
--- a/rpc/grpc/stream/go-server/profiles/release/server.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-# dubbo server yaml configure file
-application:
- organization : "ikurento.com"
- name : "BDTService"
- module : "dubbogo say-hello client"
- version : "0.0.1"
- owner : "ZX"
- environment : "dev"
-
-registries :
- "demoZk":
- protocol: "zookeeper"
- timeout : "3s"
- address: "127.0.0.1:2181"
-
-services:
- "greeterImpl":
- # 可以指定多个registry,使用逗号隔开;不指定默认向所有注册中心注册
- registry: "demoZk"
- protocol : "grpc"
- # 相当于dubbo.xml中的interface
- interface : "io.grpc.examples.helloworld.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/rpc/grpc/stream/go-server/profiles/test/log.yml b/rpc/grpc/stream/go-server/profiles/test/log.yml
deleted file mode 100644
index baee0b7..0000000
--- a/rpc/grpc/stream/go-server/profiles/test/log.yml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-level: "info"
-development: false
-disableCaller: false
-disableStacktrace: true
-sampling:
-encoding: "console"
-
-# encoder
-encoderConfig:
- messageKey: "message"
- levelKey: "level"
- timeKey: "time"
- nameKey: "logger"
- callerKey: "caller"
- stacktraceKey: "stacktrace"
- lineEnding: ""
- levelEncoder: "capitalColor"
- timeEncoder: "iso8601"
- durationEncoder: "seconds"
- callerEncoder: "short"
- nameEncoder: ""
-
-outputPaths:
- - "stderr"
-errorOutputPaths:
- - "stderr"
-initialFields:
diff --git a/rpc/grpc/stream/go-server/profiles/test/server.yml b/rpc/grpc/stream/go-server/profiles/test/server.yml
deleted file mode 100644
index 40a4892..0000000
--- a/rpc/grpc/stream/go-server/profiles/test/server.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# dubbo server yaml configure file
-
-# application config
-application:
- organization: "dubbo.io"
- name: "GreeterGrpcServer"
- module: "dubbo-go greeter grpc server"
- version: "0.0.1"
- environment: "dev"
-
-# registry config
-registries:
- "demoZk":
- protocol: "zookeeper"
- timeout: "3s"
- address: "127.0.0.1:2181"
-
-# service config
-services:
- "greeterImpl":
- registry: "demoZk"
- protocol: "grpc"
- interface: "org.apache.dubbo.GreeterGrpc$IGreeter"
- loadbalance: "random"
- warmup: "100"
- cluster: "failover"
- methods:
- - name: "SayHello"
- retries: 1
- loadbalance: "random"
-
-# protocol config
-protocols:
- "grpc":
- name: "grpc"
- port: 20000
-
-protocol_conf:
- grpc:
- session_number: 700
- session_timeout: "20s"
- getty_session_param:
- compress_encoding: false
- tcp_no_delay: true
- tcp_keep_alive: true
- keep_alive_period: "120s"
- tcp_r_buf_size: 262144
- tcp_w_buf_size: 65536
- pkg_rq_size: 1024
- pkg_wq_size: 512
- tcp_read_timeout: "1s"
- tcp_write_timeout: "5s"
- wait_timeout: "1s"
- max_msg_len: 1024
- session_name: "server"
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index e7d02c6..9c4aebf 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -89,10 +89,12 @@
#array+=("router/uniform-router/file/go-server")
#array+=("router/uniform-router/file/go-server2")
-# unclassified
-DOCKER_DIR=$(pwd)/integrate_test/dockercompose
+# config api
+array=("config-api/configcenter/nacos")
+array+=("config-api/configcenter/zookeeper")
-array=("helloworld")
+# unclassified
+array+=("helloworld")
array+=("direct")
# config-api
array+=("config-api/rpc/triple")
@@ -105,9 +107,12 @@ array+=("registry/nacos")
array+=("rpc/triple/codec-extension")
array+=("rpc/triple/hessian2")
array+=("rpc/triple/pb/dubbogo-grpc")
+array+=("rpc/grpc")
-docker-compose -f $DOCKER_DIR/docker-compose.yml up -d
+DOCKER_DIR=$(pwd)/integrate_test/dockercompose
+docker-compose -f $DOCKER_DIR/docker-compose.yml up -d
+bash -f $DOCKER_DIR/docker-health-check.sh
for((i=0;i<${#array[*]};i++))
do
./integrate_test.sh "${array[i]}"