From 0b1ee79d3ad809d4e45d68c30f4b1a860aa2aac7 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 18 Sep 2020 11:41:52 +0800 Subject: [PATCH] rename rpcx to zrpc --- doc/bookstore-en.md | 10 +++++----- doc/bookstore.md | 10 +++++----- doc/goctl-rpc.md | 6 +++--- doc/shorturl-en.md | 6 +++--- doc/shorturl.md | 6 +++--- example/bookstore/api/internal/config/config.go | 8 ++++---- .../bookstore/api/internal/svc/servicecontext.go | 8 ++++---- example/bookstore/rpc/add/add.go | 4 ++-- example/bookstore/rpc/add/adder/adder.go | 6 +++--- .../bookstore/rpc/add/internal/config/config.go | 6 +++--- example/bookstore/rpc/check/check.go | 4 ++-- example/bookstore/rpc/check/checker/checker.go | 6 +++--- .../bookstore/rpc/check/internal/config/config.go | 6 +++--- example/graceful/dns/api/config/config.go | 4 ++-- example/graceful/dns/api/graceful.go | 4 ++-- example/graceful/dns/api/svc/servicecontext.go | 4 ++-- example/graceful/dns/rpc/gracefulrpc.go | 6 +++--- example/graceful/etcd/api/config/config.go | 4 ++-- example/graceful/etcd/api/etc/graceful-api.json | 4 ++-- example/graceful/etcd/api/graceful.go | 4 ++-- example/graceful/etcd/api/svc/servicecontext.go | 4 ++-- example/graceful/etcd/rpc/etc/graceful-rpc.json | 2 +- example/graceful/etcd/rpc/gracefulrpc.go | 6 +++--- example/rpc/client/direct/client.go | 6 +++--- example/rpc/client/lb/main.go | 10 +++++----- example/rpc/client/stream/client.go | 6 +++--- example/rpc/client/unary/client.go | 6 +++--- example/rpc/proxy/proxy.go | 8 ++++---- example/rpc/server/stream/etc/config.json | 2 +- example/rpc/server/stream/server.go | 6 +++--- example/rpc/server/unary/etc/config.json | 2 +- example/rpc/server/unary/etc/config1.json | 2 +- example/rpc/server/unary/etc/k8s.json | 2 +- example/rpc/server/unary/server.go | 6 +++--- example/shorturl/api/internal/config/config.go | 4 ++-- .../shorturl/api/internal/svc/servicecontext.go | 4 ++-- .../rpc/transform/internal/config/config.go | 4 ++-- example/shorturl/rpc/transform/transform.go | 4 ++-- .../rpc/transform/transformer/transformer.go | 6 +++--- example/tracing/edge/main.go | 8 ++++---- example/tracing/portal/server.go | 14 +++++++------- example/tracing/user/server.go | 6 +++--- rest/config.go | 2 +- tools/goctl/rpc/README.md | 6 +++--- tools/goctl/rpc/gen/gencall.go | 6 +++--- tools/goctl/rpc/gen/genconfig.go | 4 ++-- tools/goctl/rpc/gen/genmain.go | 4 ++-- {rpcx => zrpc}/client.go | 6 +++--- {rpcx => zrpc}/client_test.go | 4 ++-- {rpcx => zrpc}/config.go | 2 +- {rpcx => zrpc}/config_test.go | 2 +- {rpcx => zrpc}/internal/auth/auth.go | 0 {rpcx => zrpc}/internal/auth/credential.go | 0 {rpcx => zrpc}/internal/auth/credential_test.go | 0 {rpcx => zrpc}/internal/auth/vars.go | 0 {rpcx => zrpc}/internal/balancer/p2c/p2c.go | 2 +- {rpcx => zrpc}/internal/balancer/p2c/p2c_test.go | 0 {rpcx => zrpc}/internal/chainclientinterceptors.go | 0 .../internal/chainclientinterceptors_test.go | 0 {rpcx => zrpc}/internal/chainserverinterceptors.go | 0 .../internal/chainserverinterceptors_test.go | 0 {rpcx => zrpc}/internal/client.go | 6 +++--- {rpcx => zrpc}/internal/client_test.go | 0 .../clientinterceptors/breakerinterceptor.go | 2 +- .../clientinterceptors/breakerinterceptor_test.go | 2 +- .../clientinterceptors/durationinterceptor.go | 0 .../clientinterceptors/durationinterceptor_test.go | 0 .../clientinterceptors/prommetricinterceptor.go | 0 .../prommetricinterceptor_test.go | 0 .../clientinterceptors/timeoutinterceptor.go | 0 .../clientinterceptors/timeoutinterceptor_test.go | 0 .../clientinterceptors/tracinginterceptor.go | 0 .../clientinterceptors/tracinginterceptor_test.go | 0 {rpcx => zrpc}/internal/codes/accept.go | 0 {rpcx => zrpc}/internal/codes/accept_test.go | 0 {rpcx => zrpc}/internal/mock/deposit.pb.go | 0 {rpcx => zrpc}/internal/mock/deposit.proto | 0 {rpcx => zrpc}/internal/mock/depositserver.go | 0 {rpcx => zrpc}/internal/resolver/directbuilder.go | 0 .../internal/resolver/directbuilder_test.go | 0 {rpcx => zrpc}/internal/resolver/discovbuilder.go | 0 {rpcx => zrpc}/internal/resolver/resolver.go | 0 {rpcx => zrpc}/internal/resolver/resolver_test.go | 0 {rpcx => zrpc}/internal/resolver/subset.go | 0 {rpcx => zrpc}/internal/resolver/subset_test.go | 0 {rpcx => zrpc}/internal/rpclogger.go | 0 {rpcx => zrpc}/internal/rpcpubserver.go | 0 {rpcx => zrpc}/internal/rpcserver.go | 2 +- {rpcx => zrpc}/internal/rpcserver_test.go | 0 {rpcx => zrpc}/internal/server.go | 0 {rpcx => zrpc}/internal/server_test.go | 0 .../internal/serverinterceptors/authinterceptor.go | 2 +- .../serverinterceptors/authinterceptor_test.go | 2 +- .../serverinterceptors/crashinterceptor.go | 0 .../serverinterceptors/crashinterceptor_test.go | 0 .../serverinterceptors/prommetricinterceptor.go | 0 .../prommetricinterceptor_test.go | 0 .../serverinterceptors/sheddinginterceptor.go | 0 .../serverinterceptors/sheddinginterceptor_test.go | 0 .../internal/serverinterceptors/statinterceptor.go | 0 .../serverinterceptors/statinterceptor_test.go | 0 .../serverinterceptors/timeoutinterceptor.go | 0 .../serverinterceptors/timeoutinterceptor_test.go | 0 .../serverinterceptors/tracinginterceptor.go | 0 .../serverinterceptors/tracinginterceptor_test.go | 0 {rpcx => zrpc}/internal/target.go | 2 +- {rpcx => zrpc}/internal/target_test.go | 0 {rpcx => zrpc}/proxy.go | 6 +++--- {rpcx => zrpc}/proxy_test.go | 4 ++-- {rpcx => zrpc}/server.go | 8 ++++---- 110 files changed, 154 insertions(+), 154 deletions(-) rename {rpcx => zrpc}/client.go (93%) rename {rpcx => zrpc}/client_test.go (97%) rename {rpcx => zrpc}/config.go (99%) rename {rpcx => zrpc}/config_test.go (98%) rename {rpcx => zrpc}/internal/auth/auth.go (100%) rename {rpcx => zrpc}/internal/auth/credential.go (100%) rename {rpcx => zrpc}/internal/auth/credential_test.go (100%) rename {rpcx => zrpc}/internal/auth/vars.go (100%) rename {rpcx => zrpc}/internal/balancer/p2c/p2c.go (98%) rename {rpcx => zrpc}/internal/balancer/p2c/p2c_test.go (100%) rename {rpcx => zrpc}/internal/chainclientinterceptors.go (100%) rename {rpcx => zrpc}/internal/chainclientinterceptors_test.go (100%) rename {rpcx => zrpc}/internal/chainserverinterceptors.go (100%) rename {rpcx => zrpc}/internal/chainserverinterceptors_test.go (100%) rename {rpcx => zrpc}/internal/client.go (91%) rename {rpcx => zrpc}/internal/client_test.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/breakerinterceptor.go (90%) rename {rpcx => zrpc}/internal/clientinterceptors/breakerinterceptor_test.go (96%) rename {rpcx => zrpc}/internal/clientinterceptors/durationinterceptor.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/durationinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/prommetricinterceptor.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/prommetricinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/timeoutinterceptor.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/timeoutinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/tracinginterceptor.go (100%) rename {rpcx => zrpc}/internal/clientinterceptors/tracinginterceptor_test.go (100%) rename {rpcx => zrpc}/internal/codes/accept.go (100%) rename {rpcx => zrpc}/internal/codes/accept_test.go (100%) rename {rpcx => zrpc}/internal/mock/deposit.pb.go (100%) rename {rpcx => zrpc}/internal/mock/deposit.proto (100%) rename {rpcx => zrpc}/internal/mock/depositserver.go (100%) rename {rpcx => zrpc}/internal/resolver/directbuilder.go (100%) rename {rpcx => zrpc}/internal/resolver/directbuilder_test.go (100%) rename {rpcx => zrpc}/internal/resolver/discovbuilder.go (100%) rename {rpcx => zrpc}/internal/resolver/resolver.go (100%) rename {rpcx => zrpc}/internal/resolver/resolver_test.go (100%) rename {rpcx => zrpc}/internal/resolver/subset.go (100%) rename {rpcx => zrpc}/internal/resolver/subset_test.go (100%) rename {rpcx => zrpc}/internal/rpclogger.go (100%) rename {rpcx => zrpc}/internal/rpcpubserver.go (100%) rename {rpcx => zrpc}/internal/rpcserver.go (96%) rename {rpcx => zrpc}/internal/rpcserver_test.go (100%) rename {rpcx => zrpc}/internal/server.go (100%) rename {rpcx => zrpc}/internal/server_test.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/authinterceptor.go (93%) rename {rpcx => zrpc}/internal/serverinterceptors/authinterceptor_test.go (98%) rename {rpcx => zrpc}/internal/serverinterceptors/crashinterceptor.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/crashinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/prommetricinterceptor.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/prommetricinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/sheddinginterceptor.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/sheddinginterceptor_test.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/statinterceptor.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/statinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/timeoutinterceptor.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/timeoutinterceptor_test.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/tracinginterceptor.go (100%) rename {rpcx => zrpc}/internal/serverinterceptors/tracinginterceptor_test.go (100%) rename {rpcx => zrpc}/internal/target.go (87%) rename {rpcx => zrpc}/internal/target_test.go (100%) rename {rpcx => zrpc}/proxy.go (91%) rename {rpcx => zrpc}/proxy_test.go (96%) rename {rpcx => zrpc}/server.go (94%) diff --git a/doc/bookstore-en.md b/doc/bookstore-en.md index 017d30d4..38be6b46 100644 --- a/doc/bookstore-en.md +++ b/doc/bookstore-en.md @@ -347,8 +347,8 @@ you can change the listening port in file `etc/add.yaml`. ```go type Config struct { rest.RestConf - Add rpcx.RpcClientConf // manual code - Check rpcx.RpcClientConf // manual code + Add zrpc.RpcClientConf // manual code + Check zrpc.RpcClientConf // manual code } ``` @@ -364,8 +364,8 @@ you can change the listening port in file `etc/add.yaml`. func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, - Adder: adder.NewAdder(rpcx.MustNewClient(c.Add)), // manual code - Checker: checker.NewChecker(rpcx.MustNewClient(c.Check)), // manual code + Adder: adder.NewAdder(zrpc.MustNewClient(c.Add)), // manual code + Checker: checker.NewChecker(zrpc.MustNewClient(c.Check)), // manual code } } ``` @@ -477,7 +477,7 @@ Till now, we’ve done the modification of API Gateway. All the manually added c ```go type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string // manual code Table string // manual code Cache cache.CacheConf // manual code diff --git a/doc/bookstore.md b/doc/bookstore.md index 914ad67d..55dfcca6 100644 --- a/doc/bookstore.md +++ b/doc/bookstore.md @@ -349,8 +349,8 @@ ```go type Config struct { rest.RestConf - Add rpcx.RpcClientConf // 手动代码 - Check rpcx.RpcClientConf // 手动代码 + Add zrpc.RpcClientConf // 手动代码 + Check zrpc.RpcClientConf // 手动代码 } ``` @@ -366,8 +366,8 @@ func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, - Adder: adder.NewAdder(rpcx.MustNewClient(c.Add)), // 手动代码 - Checker: checker.NewChecker(rpcx.MustNewClient(c.Check)), // 手动代码 + Adder: adder.NewAdder(zrpc.MustNewClient(c.Add)), // 手动代码 + Checker: checker.NewChecker(zrpc.MustNewClient(c.Check)), // 手动代码 } } ``` @@ -477,7 +477,7 @@ ```go type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string // 手动代码 Table string // 手动代码 Cache cache.CacheConf // 手动代码 diff --git a/doc/goctl-rpc.md b/doc/goctl-rpc.md index b85a8378..3f3d68b9 100644 --- a/doc/goctl-rpc.md +++ b/doc/goctl-rpc.md @@ -221,11 +221,11 @@ OPTIONS: *rrBalanced does not implement Picker (wrong type for Pick method) have Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) want Pick(balancer.PickInfo) (balancer.PickResult, error) - #github.com/tal-tech/go-zero/rpcx/internal/balancer/p2c - ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/rpcx/internal/balancer/p2c/p2c.go:41:32: not enough arguments in call to base.NewBalancerBuilder + #github.com/tal-tech/go-zero/zrpc/internal/balancer/p2c + ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/zrpc/internal/balancer/p2c/p2c.go:41:32: not enough arguments in call to base.NewBalancerBuilder have (string, *p2cPickerBuilder) want (string, base.PickerBuilder, base.Config) - ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/rpcx/internal/balancer/p2c/p2c.go:58:9: cannot use &p2cPicker literal (type *p2cPicker) as type balancer.Picker in return argument: + ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/zrpc/internal/balancer/p2c/p2c.go:58:9: cannot use &p2cPicker literal (type *p2cPicker) as type balancer.Picker in return argument: *p2cPicker does not implement balancer.Picker (wrong type for Pick method) have Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) want Pick(balancer.PickInfo) (balancer.PickResult, error) diff --git a/doc/shorturl-en.md b/doc/shorturl-en.md index f0f3a518..6d4a987b 100644 --- a/doc/shorturl-en.md +++ b/doc/shorturl-en.md @@ -284,7 +284,7 @@ And now, let’s walk through the complete flow of quickly create a microservice ```go type Config struct { rest.RestConf - Transform rpcx.RpcClientConf // manual code + Transform zrpc.RpcClientConf // manual code } ``` @@ -299,7 +299,7 @@ And now, let’s walk through the complete flow of quickly create a microservice func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, - Transformer: transformer.NewTransformer(rpcx.MustNewClient(c.Transform)), // manual code + Transformer: transformer.NewTransformer(zrpc.MustNewClient(c.Transform)), // manual code } } ``` @@ -409,7 +409,7 @@ Till now, we’ve done the modification of API Gateway. All the manually added c ```go type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string // manual code Table string // manual code Cache cache.CacheConf // manual code diff --git a/doc/shorturl.md b/doc/shorturl.md index 4925693e..77d39462 100644 --- a/doc/shorturl.md +++ b/doc/shorturl.md @@ -280,7 +280,7 @@ ```go type Config struct { rest.RestConf - Transform rpcx.RpcClientConf // 手动代码 + Transform zrpc.RpcClientConf // 手动代码 } ``` @@ -295,7 +295,7 @@ func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, - Transformer: transformer.NewTransformer(rpcx.MustNewClient(c.Transform)), // 手动代码 + Transformer: transformer.NewTransformer(zrpc.MustNewClient(c.Transform)), // 手动代码 } } ``` @@ -405,7 +405,7 @@ ```go type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string // 手动代码 Table string // 手动代码 Cache cache.CacheConf // 手动代码 diff --git a/example/bookstore/api/internal/config/config.go b/example/bookstore/api/internal/config/config.go index c56a81a8..50e5af8d 100644 --- a/example/bookstore/api/internal/config/config.go +++ b/example/bookstore/api/internal/config/config.go @@ -2,11 +2,11 @@ package config import ( "github.com/tal-tech/go-zero/rest" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { rest.RestConf - Add rpcx.RpcClientConf - Check rpcx.RpcClientConf -} \ No newline at end of file + Add zrpc.RpcClientConf + Check zrpc.RpcClientConf +} diff --git a/example/bookstore/api/internal/svc/servicecontext.go b/example/bookstore/api/internal/svc/servicecontext.go index 3ff4e6e8..d0ba409d 100644 --- a/example/bookstore/api/internal/svc/servicecontext.go +++ b/example/bookstore/api/internal/svc/servicecontext.go @@ -5,7 +5,7 @@ import ( "bookstore/rpc/add/adder" "bookstore/rpc/check/checker" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type ServiceContext struct { @@ -17,7 +17,7 @@ type ServiceContext struct { func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, - Adder: adder.NewAdder(rpcx.MustNewClient(c.Add)), - Checker: checker.NewChecker(rpcx.MustNewClient(c.Check)), + Adder: adder.NewAdder(zrpc.MustNewClient(c.Add)), + Checker: checker.NewChecker(zrpc.MustNewClient(c.Check)), } -} \ No newline at end of file +} diff --git a/example/bookstore/rpc/add/add.go b/example/bookstore/rpc/add/add.go index aa67cbf6..1d9d8700 100755 --- a/example/bookstore/rpc/add/add.go +++ b/example/bookstore/rpc/add/add.go @@ -14,7 +14,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/core/logx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -28,7 +28,7 @@ func main() { ctx := svc.NewServiceContext(c) adderSrv := server.NewAdderServer(ctx) - s, err := rpcx.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + s, err := zrpc.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { add.RegisterAdderServer(grpcServer, adderSrv) }) logx.Must(err) diff --git a/example/bookstore/rpc/add/adder/adder.go b/example/bookstore/rpc/add/adder/adder.go index 986e224b..d0d1cd62 100755 --- a/example/bookstore/rpc/add/adder/adder.go +++ b/example/bookstore/rpc/add/adder/adder.go @@ -10,7 +10,7 @@ import ( "context" "github.com/tal-tech/go-zero/core/jsonx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type ( @@ -19,11 +19,11 @@ type ( } defaultAdder struct { - cli rpcx.Client + cli zrpc.Client } ) -func NewAdder(cli rpcx.Client) Adder { +func NewAdder(cli zrpc.Client) Adder { return &defaultAdder{ cli: cli, } diff --git a/example/bookstore/rpc/add/internal/config/config.go b/example/bookstore/rpc/add/internal/config/config.go index ab21d014..6229ef8c 100755 --- a/example/bookstore/rpc/add/internal/config/config.go +++ b/example/bookstore/rpc/add/internal/config/config.go @@ -2,12 +2,12 @@ package config import ( "github.com/tal-tech/go-zero/core/stores/cache" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string Table string Cache cache.CacheConf -} \ No newline at end of file +} diff --git a/example/bookstore/rpc/check/check.go b/example/bookstore/rpc/check/check.go index f31c3f08..b9c2641d 100755 --- a/example/bookstore/rpc/check/check.go +++ b/example/bookstore/rpc/check/check.go @@ -14,7 +14,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/core/logx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -28,7 +28,7 @@ func main() { ctx := svc.NewServiceContext(c) checkerSrv := server.NewCheckerServer(ctx) - s, err := rpcx.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + s, err := zrpc.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { check.RegisterCheckerServer(grpcServer, checkerSrv) }) logx.Must(err) diff --git a/example/bookstore/rpc/check/checker/checker.go b/example/bookstore/rpc/check/checker/checker.go index a61c0f4c..600f0ec1 100755 --- a/example/bookstore/rpc/check/checker/checker.go +++ b/example/bookstore/rpc/check/checker/checker.go @@ -10,7 +10,7 @@ import ( "context" "github.com/tal-tech/go-zero/core/jsonx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type ( @@ -19,11 +19,11 @@ type ( } defaultChecker struct { - cli rpcx.Client + cli zrpc.Client } ) -func NewChecker(cli rpcx.Client) Checker { +func NewChecker(cli zrpc.Client) Checker { return &defaultChecker{ cli: cli, } diff --git a/example/bookstore/rpc/check/internal/config/config.go b/example/bookstore/rpc/check/internal/config/config.go index ab21d014..6229ef8c 100755 --- a/example/bookstore/rpc/check/internal/config/config.go +++ b/example/bookstore/rpc/check/internal/config/config.go @@ -2,12 +2,12 @@ package config import ( "github.com/tal-tech/go-zero/core/stores/cache" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string Table string Cache cache.CacheConf -} \ No newline at end of file +} diff --git a/example/graceful/dns/api/config/config.go b/example/graceful/dns/api/config/config.go index 3b0ef53a..d0a35d0c 100644 --- a/example/graceful/dns/api/config/config.go +++ b/example/graceful/dns/api/config/config.go @@ -2,10 +2,10 @@ package config import ( "github.com/tal-tech/go-zero/rest" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { rest.RestConf - Rpc rpcx.RpcClientConf + Rpc zrpc.RpcClientConf } diff --git a/example/graceful/dns/api/graceful.go b/example/graceful/dns/api/graceful.go index 19601ccb..9aa04cec 100644 --- a/example/graceful/dns/api/graceful.go +++ b/example/graceful/dns/api/graceful.go @@ -8,7 +8,7 @@ import ( "github.com/tal-tech/go-zero/example/graceful/dns/api/handler" "github.com/tal-tech/go-zero/example/graceful/dns/api/svc" "github.com/tal-tech/go-zero/rest" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) var configFile = flag.String("f", "etc/graceful-api.json", "the config file") @@ -19,7 +19,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - client := rpcx.MustNewClient(c.Rpc) + client := zrpc.MustNewClient(c.Rpc) ctx := &svc.ServiceContext{ Client: client, } diff --git a/example/graceful/dns/api/svc/servicecontext.go b/example/graceful/dns/api/svc/servicecontext.go index 42d8d4b7..b6cb91fb 100644 --- a/example/graceful/dns/api/svc/servicecontext.go +++ b/example/graceful/dns/api/svc/servicecontext.go @@ -1,7 +1,7 @@ package svc -import "github.com/tal-tech/go-zero/rpcx" +import "github.com/tal-tech/go-zero/zrpc" type ServiceContext struct { - Client rpcx.Client + Client zrpc.Client } diff --git a/example/graceful/dns/rpc/gracefulrpc.go b/example/graceful/dns/rpc/gracefulrpc.go index a882adaf..d33449b0 100644 --- a/example/graceful/dns/rpc/gracefulrpc.go +++ b/example/graceful/dns/rpc/gracefulrpc.go @@ -9,7 +9,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/graceful/dns/rpc/graceful" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -39,10 +39,10 @@ func (gs *GracefulServer) Grace(ctx context.Context, req *graceful.Request) (*gr func main() { flag.Parse() - var c rpcx.RpcServerConf + var c zrpc.RpcServerConf conf.MustLoad(*configFile, &c) - server := rpcx.MustNewServer(c, func(grpcServer *grpc.Server) { + server := zrpc.MustNewServer(c, func(grpcServer *grpc.Server) { graceful.RegisterGraceServiceServer(grpcServer, NewGracefulServer()) }) defer server.Stop() diff --git a/example/graceful/etcd/api/config/config.go b/example/graceful/etcd/api/config/config.go index 3b0ef53a..d0a35d0c 100644 --- a/example/graceful/etcd/api/config/config.go +++ b/example/graceful/etcd/api/config/config.go @@ -2,10 +2,10 @@ package config import ( "github.com/tal-tech/go-zero/rest" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { rest.RestConf - Rpc rpcx.RpcClientConf + Rpc zrpc.RpcClientConf } diff --git a/example/graceful/etcd/api/etc/graceful-api.json b/example/graceful/etcd/api/etc/graceful-api.json index c46bd216..a13f5fab 100644 --- a/example/graceful/etcd/api/etc/graceful-api.json +++ b/example/graceful/etcd/api/etc/graceful-api.json @@ -6,7 +6,7 @@ "Rpc": { "Etcd": { "Hosts": ["etcd.discov:2379"], - "Key": "rpcx" + "Key": "zrpc" } } -} \ No newline at end of file +} diff --git a/example/graceful/etcd/api/graceful.go b/example/graceful/etcd/api/graceful.go index 3fdfd344..ad8c83b6 100644 --- a/example/graceful/etcd/api/graceful.go +++ b/example/graceful/etcd/api/graceful.go @@ -8,7 +8,7 @@ import ( "github.com/tal-tech/go-zero/example/graceful/etcd/api/handler" "github.com/tal-tech/go-zero/example/graceful/etcd/api/svc" "github.com/tal-tech/go-zero/rest" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) var configFile = flag.String("f", "etc/graceful-api.json", "the config file") @@ -19,7 +19,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - client := rpcx.MustNewClient(c.Rpc) + client := zrpc.MustNewClient(c.Rpc) ctx := &svc.ServiceContext{ Client: client, } diff --git a/example/graceful/etcd/api/svc/servicecontext.go b/example/graceful/etcd/api/svc/servicecontext.go index 42d8d4b7..b6cb91fb 100644 --- a/example/graceful/etcd/api/svc/servicecontext.go +++ b/example/graceful/etcd/api/svc/servicecontext.go @@ -1,7 +1,7 @@ package svc -import "github.com/tal-tech/go-zero/rpcx" +import "github.com/tal-tech/go-zero/zrpc" type ServiceContext struct { - Client rpcx.Client + Client zrpc.Client } diff --git a/example/graceful/etcd/rpc/etc/graceful-rpc.json b/example/graceful/etcd/rpc/etc/graceful-rpc.json index 98614e62..73a96797 100644 --- a/example/graceful/etcd/rpc/etc/graceful-rpc.json +++ b/example/graceful/etcd/rpc/etc/graceful-rpc.json @@ -3,6 +3,6 @@ "ListenOn": "0.0.0.0:3456", "Etcd": { "Hosts": ["etcd.discov:2379"], - "Key": "rpcx" + "Key": "zrpc" } } diff --git a/example/graceful/etcd/rpc/gracefulrpc.go b/example/graceful/etcd/rpc/gracefulrpc.go index 310aa0fc..5d2e54aa 100644 --- a/example/graceful/etcd/rpc/gracefulrpc.go +++ b/example/graceful/etcd/rpc/gracefulrpc.go @@ -9,7 +9,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/graceful/etcd/rpc/graceful" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -39,10 +39,10 @@ func (gs *GracefulServer) Grace(ctx context.Context, req *graceful.Request) (*gr func main() { flag.Parse() - var c rpcx.RpcServerConf + var c zrpc.RpcServerConf conf.MustLoad(*configFile, &c) - server := rpcx.MustNewServer(c, func(grpcServer *grpc.Server) { + server := zrpc.MustNewServer(c, func(grpcServer *grpc.Server) { graceful.RegisterGraceServiceServer(grpcServer, NewGracefulServer()) }) defer server.Stop() diff --git a/example/rpc/client/direct/client.go b/example/rpc/client/direct/client.go index 1c9ab951..d9caf4e9 100644 --- a/example/rpc/client/direct/client.go +++ b/example/rpc/client/direct/client.go @@ -8,7 +8,7 @@ import ( "github.com/tal-tech/go-zero/core/discov" "github.com/tal-tech/go-zero/example/rpc/remote/unary" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) const timeFormat = "15:04:05" @@ -16,10 +16,10 @@ const timeFormat = "15:04:05" func main() { flag.Parse() - client := rpcx.MustNewClient(rpcx.RpcClientConf{ + client := zrpc.MustNewClient(zrpc.RpcClientConf{ Etcd: discov.EtcdConf{ Hosts: []string{"localhost:2379"}, - Key: "rpcx", + Key: "zrpc", }, }) diff --git a/example/rpc/client/lb/main.go b/example/rpc/client/lb/main.go index 0794390c..48a86230 100644 --- a/example/rpc/client/lb/main.go +++ b/example/rpc/client/lb/main.go @@ -9,7 +9,7 @@ import ( "github.com/tal-tech/go-zero/core/discov" "github.com/tal-tech/go-zero/example/rpc/remote/unary" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) var lb = flag.String("t", "direct", "the load balancer type") @@ -17,20 +17,20 @@ var lb = flag.String("t", "direct", "the load balancer type") func main() { flag.Parse() - var cli rpcx.Client + var cli zrpc.Client switch *lb { case "direct": - cli = rpcx.MustNewClient(rpcx.RpcClientConf{ + cli = zrpc.MustNewClient(zrpc.RpcClientConf{ Endpoints: []string{ "localhost:3456", "localhost:3457", }, }) case "discov": - cli = rpcx.MustNewClient(rpcx.RpcClientConf{ + cli = zrpc.MustNewClient(zrpc.RpcClientConf{ Etcd: discov.EtcdConf{ Hosts: []string{"localhost:2379"}, - Key: "rpcx", + Key: "zrpc", }, }) default: diff --git a/example/rpc/client/stream/client.go b/example/rpc/client/stream/client.go index a116bcf2..d680a079 100644 --- a/example/rpc/client/stream/client.go +++ b/example/rpc/client/stream/client.go @@ -8,17 +8,17 @@ import ( "github.com/tal-tech/go-zero/core/discov" "github.com/tal-tech/go-zero/example/rpc/remote/stream" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) const name = "kevin" -var key = flag.String("key", "rpcx", "the key on etcd") +var key = flag.String("key", "zrpc", "the key on etcd") func main() { flag.Parse() - client, err := rpcx.NewClientNoAuth(discov.EtcdConf{ + client, err := zrpc.NewClientNoAuth(discov.EtcdConf{ Hosts: []string{"localhost:2379"}, Key: *key, }) diff --git a/example/rpc/client/unary/client.go b/example/rpc/client/unary/client.go index 019921d2..b2425d8f 100644 --- a/example/rpc/client/unary/client.go +++ b/example/rpc/client/unary/client.go @@ -8,7 +8,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/rpc/remote/unary" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) var configFile = flag.String("f", "config.json", "the config file") @@ -16,9 +16,9 @@ var configFile = flag.String("f", "config.json", "the config file") func main() { flag.Parse() - var c rpcx.RpcClientConf + var c zrpc.RpcClientConf conf.MustLoad(*configFile, &c) - client := rpcx.MustNewClient(c) + client := zrpc.MustNewClient(c) ticker := time.NewTicker(time.Millisecond * 500) defer ticker.Stop() for { diff --git a/example/rpc/proxy/proxy.go b/example/rpc/proxy/proxy.go index 06874c7e..408385e0 100644 --- a/example/rpc/proxy/proxy.go +++ b/example/rpc/proxy/proxy.go @@ -7,7 +7,7 @@ import ( "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/core/service" "github.com/tal-tech/go-zero/example/rpc/remote/unary" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -17,7 +17,7 @@ var ( ) type GreetServer struct { - *rpcx.RpcProxy + *zrpc.RpcProxy } func (s *GreetServer) Greet(ctx context.Context, req *unary.Request) (*unary.Response, error) { @@ -33,7 +33,7 @@ func (s *GreetServer) Greet(ctx context.Context, req *unary.Request) (*unary.Res func main() { flag.Parse() - proxy := rpcx.MustNewServer(rpcx.RpcServerConf{ + proxy := zrpc.MustNewServer(zrpc.RpcServerConf{ ServiceConf: service.ServiceConf{ Log: logx.LogConf{ Mode: "console", @@ -42,7 +42,7 @@ func main() { ListenOn: *listen, }, func(grpcServer *grpc.Server) { unary.RegisterGreeterServer(grpcServer, &GreetServer{ - RpcProxy: rpcx.NewProxy(*server), + RpcProxy: zrpc.NewProxy(*server), }) }) proxy.Start() diff --git a/example/rpc/server/stream/etc/config.json b/example/rpc/server/stream/etc/config.json index 20c3688e..4bf8de51 100644 --- a/example/rpc/server/stream/etc/config.json +++ b/example/rpc/server/stream/etc/config.json @@ -6,7 +6,7 @@ "Hosts": [ "localhost:2379" ], - "Key": "rpcx" + "Key": "zrpc" }, "Redis": { "Host": "localhost:6379", diff --git a/example/rpc/server/stream/server.go b/example/rpc/server/stream/server.go index b7d7a3ad..f636a3bd 100644 --- a/example/rpc/server/stream/server.go +++ b/example/rpc/server/stream/server.go @@ -6,7 +6,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/rpc/remote/stream" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -39,10 +39,10 @@ func (gs StreamGreetServer) Greet(s stream.StreamGreeter_GreetServer) error { } func main() { - var c rpcx.RpcServerConf + var c zrpc.RpcServerConf conf.MustLoad("etc/config.json", &c) - server := rpcx.MustNewServer(c, func(grpcServer *grpc.Server) { + server := zrpc.MustNewServer(c, func(grpcServer *grpc.Server) { stream.RegisterStreamGreeterServer(grpcServer, StreamGreetServer(0)) }) server.Start() diff --git a/example/rpc/server/unary/etc/config.json b/example/rpc/server/unary/etc/config.json index 7a01b7fb..27431073 100644 --- a/example/rpc/server/unary/etc/config.json +++ b/example/rpc/server/unary/etc/config.json @@ -8,6 +8,6 @@ "Hosts": [ "localhost:2379" ], - "Key": "rpcx" + "Key": "zrpc" } } diff --git a/example/rpc/server/unary/etc/config1.json b/example/rpc/server/unary/etc/config1.json index 1cc72a63..f460e12d 100644 --- a/example/rpc/server/unary/etc/config1.json +++ b/example/rpc/server/unary/etc/config1.json @@ -8,6 +8,6 @@ "Hosts": [ "localhost:2379" ], - "Key": "rpcx" + "Key": "zrpc" } } diff --git a/example/rpc/server/unary/etc/k8s.json b/example/rpc/server/unary/etc/k8s.json index 1fb61444..3a775b33 100644 --- a/example/rpc/server/unary/etc/k8s.json +++ b/example/rpc/server/unary/etc/k8s.json @@ -6,7 +6,7 @@ "Hosts": [ "etcd.discov:2379" ], - "Key": "rpcx" + "Key": "zrpc" }, "Timeout": 500 } diff --git a/example/rpc/server/unary/server.go b/example/rpc/server/unary/server.go index 229ea820..75e9846f 100644 --- a/example/rpc/server/unary/server.go +++ b/example/rpc/server/unary/server.go @@ -10,7 +10,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/rpc/remote/unary" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -44,10 +44,10 @@ func (gs *GreetServer) Greet(ctx context.Context, req *unary.Request) (*unary.Re func main() { flag.Parse() - var c rpcx.RpcServerConf + var c zrpc.RpcServerConf conf.MustLoad(*configFile, &c) - server := rpcx.MustNewServer(c, func(grpcServer *grpc.Server) { + server := zrpc.MustNewServer(c, func(grpcServer *grpc.Server) { unary.RegisterGreeterServer(grpcServer, NewGreetServer()) }) server.Start() diff --git a/example/shorturl/api/internal/config/config.go b/example/shorturl/api/internal/config/config.go index 3fe7855e..4a5a38b3 100644 --- a/example/shorturl/api/internal/config/config.go +++ b/example/shorturl/api/internal/config/config.go @@ -2,10 +2,10 @@ package config import ( "github.com/tal-tech/go-zero/rest" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { rest.RestConf - Transform rpcx.RpcClientConf + Transform zrpc.RpcClientConf } diff --git a/example/shorturl/api/internal/svc/servicecontext.go b/example/shorturl/api/internal/svc/servicecontext.go index 94123b1a..62956805 100644 --- a/example/shorturl/api/internal/svc/servicecontext.go +++ b/example/shorturl/api/internal/svc/servicecontext.go @@ -4,7 +4,7 @@ import ( "shorturl/api/internal/config" "shorturl/rpc/transform/transformer" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type ServiceContext struct { @@ -15,6 +15,6 @@ type ServiceContext struct { func NewServiceContext(c config.Config) *ServiceContext { return &ServiceContext{ Config: c, - Transformer: transformer.NewTransformer(rpcx.MustNewClient(c.Transform)), + Transformer: transformer.NewTransformer(zrpc.MustNewClient(c.Transform)), } } diff --git a/example/shorturl/rpc/transform/internal/config/config.go b/example/shorturl/rpc/transform/internal/config/config.go index 84d795de..6229ef8c 100755 --- a/example/shorturl/rpc/transform/internal/config/config.go +++ b/example/shorturl/rpc/transform/internal/config/config.go @@ -2,11 +2,11 @@ package config import ( "github.com/tal-tech/go-zero/core/stores/cache" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf DataSource string Table string Cache cache.CacheConf diff --git a/example/shorturl/rpc/transform/transform.go b/example/shorturl/rpc/transform/transform.go index b928739d..e3969992 100755 --- a/example/shorturl/rpc/transform/transform.go +++ b/example/shorturl/rpc/transform/transform.go @@ -14,7 +14,7 @@ import ( transform "shorturl/rpc/transform/pb" "github.com/tal-tech/go-zero/core/conf" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -28,7 +28,7 @@ func main() { ctx := svc.NewServiceContext(c) transformerSrv := server.NewTransformerServer(ctx) - s, err := rpcx.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + s, err := zrpc.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { transform.RegisterTransformerServer(grpcServer, transformerSrv) }) if err != nil { diff --git a/example/shorturl/rpc/transform/transformer/transformer.go b/example/shorturl/rpc/transform/transformer/transformer.go index c97650dc..a47ec0ba 100755 --- a/example/shorturl/rpc/transform/transformer/transformer.go +++ b/example/shorturl/rpc/transform/transformer/transformer.go @@ -11,7 +11,7 @@ import ( transform "shorturl/rpc/transform/pb" "github.com/tal-tech/go-zero/core/jsonx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type ( @@ -21,11 +21,11 @@ type ( } defaultTransformer struct { - cli rpcx.Client + cli zrpc.Client } ) -func NewTransformer(cli rpcx.Client) Transformer { +func NewTransformer(cli zrpc.Client) Transformer { return &defaultTransformer{ cli: cli, } diff --git a/example/tracing/edge/main.go b/example/tracing/edge/main.go index 90087517..9cdcedad 100644 --- a/example/tracing/edge/main.go +++ b/example/tracing/edge/main.go @@ -10,17 +10,17 @@ import ( "github.com/tal-tech/go-zero/example/tracing/remote/portal" "github.com/tal-tech/go-zero/rest" "github.com/tal-tech/go-zero/rest/httpx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) var ( configFile = flag.String("f", "config.json", "the config file") - client rpcx.Client + client zrpc.Client ) type Config struct { rest.RestConf - Portal rpcx.RpcClientConf + Portal zrpc.RpcClientConf } func handle(w http.ResponseWriter, r *http.Request) { @@ -41,7 +41,7 @@ func main() { var c Config conf.MustLoad(*configFile, &c) - client = rpcx.MustNewClient(c.Portal) + client = zrpc.MustNewClient(c.Portal) engine := rest.MustNewServer(rest.RestConf{ ServiceConf: service.ServiceConf{ Log: logx.LogConf{ diff --git a/example/tracing/portal/server.go b/example/tracing/portal/server.go index 6c5e0c4d..bbdffb88 100644 --- a/example/tracing/portal/server.go +++ b/example/tracing/portal/server.go @@ -7,7 +7,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/tracing/remote/portal" "github.com/tal-tech/go-zero/example/tracing/remote/user" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -15,16 +15,16 @@ var configFile = flag.String("f", "etc/config.json", "the config file") type ( Config struct { - rpcx.RpcServerConf - UserRpc rpcx.RpcClientConf + zrpc.RpcServerConf + UserRpc zrpc.RpcClientConf } PortalServer struct { - userRpc rpcx.Client + userRpc zrpc.Client } ) -func NewPortalServer(client rpcx.Client) *PortalServer { +func NewPortalServer(client zrpc.Client) *PortalServer { return &PortalServer{ userRpc: client, } @@ -53,8 +53,8 @@ func main() { var c Config conf.MustLoad(*configFile, &c) - client := rpcx.MustNewClient(c.UserRpc) - server := rpcx.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + client := zrpc.MustNewClient(c.UserRpc) + server := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { portal.RegisterPortalServer(grpcServer, NewPortalServer(client)) }) server.Start() diff --git a/example/tracing/user/server.go b/example/tracing/user/server.go index 33158f07..a41f66fd 100644 --- a/example/tracing/user/server.go +++ b/example/tracing/user/server.go @@ -10,7 +10,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/example/tracing/remote/user" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -44,10 +44,10 @@ func (gs *UserServer) GetGrade(ctx context.Context, req *user.UserRequest) (*use func main() { flag.Parse() - var c rpcx.RpcServerConf + var c zrpc.RpcServerConf conf.MustLoad(*configFile, &c) - server := rpcx.MustNewServer(c, func(grpcServer *grpc.Server) { + server := zrpc.MustNewServer(c, func(grpcServer *grpc.Server) { user.RegisterUserServer(grpcServer, NewUserServer()) }) server.Start() diff --git a/rest/config.go b/rest/config.go index 5d8a1b51..d3a09330 100644 --- a/rest/config.go +++ b/rest/config.go @@ -20,7 +20,7 @@ type ( // why not name it as Conf, because we need to consider usage like: // type Config struct { - // rpcx.RpcConf + // zrpc.RpcConf // rest.RestConf // } // if with the name Conf, there will be two Conf inside Config. diff --git a/tools/goctl/rpc/README.md b/tools/goctl/rpc/README.md index 60d1adf3..010cee0d 100644 --- a/tools/goctl/rpc/README.md +++ b/tools/goctl/rpc/README.md @@ -220,11 +220,11 @@ OPTIONS: *rrBalanced does not implement Picker (wrong type for Pick method) have Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) want Pick(balancer.PickInfo) (balancer.PickResult, error) - #github.com/tal-tech/go-zero/rpcx/internal/balancer/p2c - ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/rpcx/internal/balancer/p2c/p2c.go:41:32: not enough arguments in call to base.NewBalancerBuilder + #github.com/tal-tech/go-zero/zrpc/internal/balancer/p2c + ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/zrpc/internal/balancer/p2c/p2c.go:41:32: not enough arguments in call to base.NewBalancerBuilder have (string, *p2cPickerBuilder) want (string, base.PickerBuilder, base.Config) - ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/rpcx/internal/balancer/p2c/p2c.go:58:9: cannot use &p2cPicker literal (type *p2cPicker) as type balancer.Picker in return argument: + ../../../go/pkg/mod/github.com/tal-tech/go-zero@v1.0.12/zrpc/internal/balancer/p2c/p2c.go:58:9: cannot use &p2cPicker literal (type *p2cPicker) as type balancer.Picker in return argument: *p2cPicker does not implement balancer.Picker (wrong type for Pick method) have Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error) want Pick(balancer.PickInfo) (balancer.PickResult, error) diff --git a/tools/goctl/rpc/gen/gencall.go b/tools/goctl/rpc/gen/gencall.go index 61e71e72..3f3eb3aa 100644 --- a/tools/goctl/rpc/gen/gencall.go +++ b/tools/goctl/rpc/gen/gencall.go @@ -25,7 +25,7 @@ import ( {{.package}} "github.com/tal-tech/go-zero/core/jsonx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" ) type ( @@ -34,11 +34,11 @@ type ( } default{{.serviceName}} struct { - cli rpcx.Client + cli zrpc.Client } ) -func New{{.serviceName}}(cli rpcx.Client) {{.serviceName}} { +func New{{.serviceName}}(cli zrpc.Client) {{.serviceName}} { return &default{{.serviceName}}{ cli: cli, } diff --git a/tools/goctl/rpc/gen/genconfig.go b/tools/goctl/rpc/gen/genconfig.go index 559b7a1b..466a1e11 100644 --- a/tools/goctl/rpc/gen/genconfig.go +++ b/tools/goctl/rpc/gen/genconfig.go @@ -10,10 +10,10 @@ import ( const configTemplate = `package config -import "github.com/tal-tech/go-zero/rpcx" +import "github.com/tal-tech/go-zero/zrpc" type Config struct { - rpcx.RpcServerConf + zrpc.RpcServerConf } ` diff --git a/tools/goctl/rpc/gen/genmain.go b/tools/goctl/rpc/gen/genmain.go index baaa6e82..938c07da 100644 --- a/tools/goctl/rpc/gen/genmain.go +++ b/tools/goctl/rpc/gen/genmain.go @@ -21,7 +21,7 @@ import ( "github.com/tal-tech/go-zero/core/conf" "github.com/tal-tech/go-zero/core/logx" - "github.com/tal-tech/go-zero/rpcx" + "github.com/tal-tech/go-zero/zrpc" "google.golang.org/grpc" ) @@ -35,7 +35,7 @@ func main() { ctx := svc.NewServiceContext(c) {{.srv}} - s, err := rpcx.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + s, err := zrpc.NewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { {{.registers}} }) logx.Must(err) diff --git a/rpcx/client.go b/zrpc/client.go similarity index 93% rename from rpcx/client.go rename to zrpc/client.go index 0e77a750..eda789d6 100644 --- a/rpcx/client.go +++ b/zrpc/client.go @@ -1,12 +1,12 @@ -package rpcx +package zrpc import ( "log" "time" "github.com/tal-tech/go-zero/core/discov" - "github.com/tal-tech/go-zero/rpcx/internal" - "github.com/tal-tech/go-zero/rpcx/internal/auth" + "github.com/tal-tech/go-zero/zrpc/internal" + "github.com/tal-tech/go-zero/zrpc/internal/auth" "google.golang.org/grpc" ) diff --git a/rpcx/client_test.go b/zrpc/client_test.go similarity index 97% rename from rpcx/client_test.go rename to zrpc/client_test.go index 38499a0b..b048f32c 100644 --- a/rpcx/client_test.go +++ b/zrpc/client_test.go @@ -1,4 +1,4 @@ -package rpcx +package zrpc import ( "context" @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/tal-tech/go-zero/core/logx" - "github.com/tal-tech/go-zero/rpcx/internal/mock" + "github.com/tal-tech/go-zero/zrpc/internal/mock" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/rpcx/config.go b/zrpc/config.go similarity index 99% rename from rpcx/config.go rename to zrpc/config.go index 0961b466..e3edcaf3 100644 --- a/rpcx/config.go +++ b/zrpc/config.go @@ -1,4 +1,4 @@ -package rpcx +package zrpc import ( "github.com/tal-tech/go-zero/core/discov" diff --git a/rpcx/config_test.go b/zrpc/config_test.go similarity index 98% rename from rpcx/config_test.go rename to zrpc/config_test.go index e9b45c29..67d2a4b3 100644 --- a/rpcx/config_test.go +++ b/zrpc/config_test.go @@ -1,4 +1,4 @@ -package rpcx +package zrpc import ( "testing" diff --git a/rpcx/internal/auth/auth.go b/zrpc/internal/auth/auth.go similarity index 100% rename from rpcx/internal/auth/auth.go rename to zrpc/internal/auth/auth.go diff --git a/rpcx/internal/auth/credential.go b/zrpc/internal/auth/credential.go similarity index 100% rename from rpcx/internal/auth/credential.go rename to zrpc/internal/auth/credential.go diff --git a/rpcx/internal/auth/credential_test.go b/zrpc/internal/auth/credential_test.go similarity index 100% rename from rpcx/internal/auth/credential_test.go rename to zrpc/internal/auth/credential_test.go diff --git a/rpcx/internal/auth/vars.go b/zrpc/internal/auth/vars.go similarity index 100% rename from rpcx/internal/auth/vars.go rename to zrpc/internal/auth/vars.go diff --git a/rpcx/internal/balancer/p2c/p2c.go b/zrpc/internal/balancer/p2c/p2c.go similarity index 98% rename from rpcx/internal/balancer/p2c/p2c.go rename to zrpc/internal/balancer/p2c/p2c.go index 431874e9..7cbbaabd 100644 --- a/rpcx/internal/balancer/p2c/p2c.go +++ b/zrpc/internal/balancer/p2c/p2c.go @@ -13,7 +13,7 @@ import ( "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/core/syncx" "github.com/tal-tech/go-zero/core/timex" - "github.com/tal-tech/go-zero/rpcx/internal/codes" + "github.com/tal-tech/go-zero/zrpc/internal/codes" "google.golang.org/grpc/balancer" "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/resolver" diff --git a/rpcx/internal/balancer/p2c/p2c_test.go b/zrpc/internal/balancer/p2c/p2c_test.go similarity index 100% rename from rpcx/internal/balancer/p2c/p2c_test.go rename to zrpc/internal/balancer/p2c/p2c_test.go diff --git a/rpcx/internal/chainclientinterceptors.go b/zrpc/internal/chainclientinterceptors.go similarity index 100% rename from rpcx/internal/chainclientinterceptors.go rename to zrpc/internal/chainclientinterceptors.go diff --git a/rpcx/internal/chainclientinterceptors_test.go b/zrpc/internal/chainclientinterceptors_test.go similarity index 100% rename from rpcx/internal/chainclientinterceptors_test.go rename to zrpc/internal/chainclientinterceptors_test.go diff --git a/rpcx/internal/chainserverinterceptors.go b/zrpc/internal/chainserverinterceptors.go similarity index 100% rename from rpcx/internal/chainserverinterceptors.go rename to zrpc/internal/chainserverinterceptors.go diff --git a/rpcx/internal/chainserverinterceptors_test.go b/zrpc/internal/chainserverinterceptors_test.go similarity index 100% rename from rpcx/internal/chainserverinterceptors_test.go rename to zrpc/internal/chainserverinterceptors_test.go diff --git a/rpcx/internal/client.go b/zrpc/internal/client.go similarity index 91% rename from rpcx/internal/client.go rename to zrpc/internal/client.go index dae6d3f2..3ae36605 100644 --- a/rpcx/internal/client.go +++ b/zrpc/internal/client.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/tal-tech/go-zero/rpcx/internal/balancer/p2c" - "github.com/tal-tech/go-zero/rpcx/internal/clientinterceptors" - "github.com/tal-tech/go-zero/rpcx/internal/resolver" + "github.com/tal-tech/go-zero/zrpc/internal/balancer/p2c" + "github.com/tal-tech/go-zero/zrpc/internal/clientinterceptors" + "github.com/tal-tech/go-zero/zrpc/internal/resolver" "google.golang.org/grpc" ) diff --git a/rpcx/internal/client_test.go b/zrpc/internal/client_test.go similarity index 100% rename from rpcx/internal/client_test.go rename to zrpc/internal/client_test.go diff --git a/rpcx/internal/clientinterceptors/breakerinterceptor.go b/zrpc/internal/clientinterceptors/breakerinterceptor.go similarity index 90% rename from rpcx/internal/clientinterceptors/breakerinterceptor.go rename to zrpc/internal/clientinterceptors/breakerinterceptor.go index 014e888a..2163a497 100644 --- a/rpcx/internal/clientinterceptors/breakerinterceptor.go +++ b/zrpc/internal/clientinterceptors/breakerinterceptor.go @@ -5,7 +5,7 @@ import ( "path" "github.com/tal-tech/go-zero/core/breaker" - "github.com/tal-tech/go-zero/rpcx/internal/codes" + "github.com/tal-tech/go-zero/zrpc/internal/codes" "google.golang.org/grpc" ) diff --git a/rpcx/internal/clientinterceptors/breakerinterceptor_test.go b/zrpc/internal/clientinterceptors/breakerinterceptor_test.go similarity index 96% rename from rpcx/internal/clientinterceptors/breakerinterceptor_test.go rename to zrpc/internal/clientinterceptors/breakerinterceptor_test.go index 63f30b41..5d0f9035 100644 --- a/rpcx/internal/clientinterceptors/breakerinterceptor_test.go +++ b/zrpc/internal/clientinterceptors/breakerinterceptor_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/tal-tech/go-zero/core/breaker" "github.com/tal-tech/go-zero/core/stat" - rcodes "github.com/tal-tech/go-zero/rpcx/internal/codes" + rcodes "github.com/tal-tech/go-zero/zrpc/internal/codes" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/rpcx/internal/clientinterceptors/durationinterceptor.go b/zrpc/internal/clientinterceptors/durationinterceptor.go similarity index 100% rename from rpcx/internal/clientinterceptors/durationinterceptor.go rename to zrpc/internal/clientinterceptors/durationinterceptor.go diff --git a/rpcx/internal/clientinterceptors/durationinterceptor_test.go b/zrpc/internal/clientinterceptors/durationinterceptor_test.go similarity index 100% rename from rpcx/internal/clientinterceptors/durationinterceptor_test.go rename to zrpc/internal/clientinterceptors/durationinterceptor_test.go diff --git a/rpcx/internal/clientinterceptors/prommetricinterceptor.go b/zrpc/internal/clientinterceptors/prommetricinterceptor.go similarity index 100% rename from rpcx/internal/clientinterceptors/prommetricinterceptor.go rename to zrpc/internal/clientinterceptors/prommetricinterceptor.go diff --git a/rpcx/internal/clientinterceptors/prommetricinterceptor_test.go b/zrpc/internal/clientinterceptors/prommetricinterceptor_test.go similarity index 100% rename from rpcx/internal/clientinterceptors/prommetricinterceptor_test.go rename to zrpc/internal/clientinterceptors/prommetricinterceptor_test.go diff --git a/rpcx/internal/clientinterceptors/timeoutinterceptor.go b/zrpc/internal/clientinterceptors/timeoutinterceptor.go similarity index 100% rename from rpcx/internal/clientinterceptors/timeoutinterceptor.go rename to zrpc/internal/clientinterceptors/timeoutinterceptor.go diff --git a/rpcx/internal/clientinterceptors/timeoutinterceptor_test.go b/zrpc/internal/clientinterceptors/timeoutinterceptor_test.go similarity index 100% rename from rpcx/internal/clientinterceptors/timeoutinterceptor_test.go rename to zrpc/internal/clientinterceptors/timeoutinterceptor_test.go diff --git a/rpcx/internal/clientinterceptors/tracinginterceptor.go b/zrpc/internal/clientinterceptors/tracinginterceptor.go similarity index 100% rename from rpcx/internal/clientinterceptors/tracinginterceptor.go rename to zrpc/internal/clientinterceptors/tracinginterceptor.go diff --git a/rpcx/internal/clientinterceptors/tracinginterceptor_test.go b/zrpc/internal/clientinterceptors/tracinginterceptor_test.go similarity index 100% rename from rpcx/internal/clientinterceptors/tracinginterceptor_test.go rename to zrpc/internal/clientinterceptors/tracinginterceptor_test.go diff --git a/rpcx/internal/codes/accept.go b/zrpc/internal/codes/accept.go similarity index 100% rename from rpcx/internal/codes/accept.go rename to zrpc/internal/codes/accept.go diff --git a/rpcx/internal/codes/accept_test.go b/zrpc/internal/codes/accept_test.go similarity index 100% rename from rpcx/internal/codes/accept_test.go rename to zrpc/internal/codes/accept_test.go diff --git a/rpcx/internal/mock/deposit.pb.go b/zrpc/internal/mock/deposit.pb.go similarity index 100% rename from rpcx/internal/mock/deposit.pb.go rename to zrpc/internal/mock/deposit.pb.go diff --git a/rpcx/internal/mock/deposit.proto b/zrpc/internal/mock/deposit.proto similarity index 100% rename from rpcx/internal/mock/deposit.proto rename to zrpc/internal/mock/deposit.proto diff --git a/rpcx/internal/mock/depositserver.go b/zrpc/internal/mock/depositserver.go similarity index 100% rename from rpcx/internal/mock/depositserver.go rename to zrpc/internal/mock/depositserver.go diff --git a/rpcx/internal/resolver/directbuilder.go b/zrpc/internal/resolver/directbuilder.go similarity index 100% rename from rpcx/internal/resolver/directbuilder.go rename to zrpc/internal/resolver/directbuilder.go diff --git a/rpcx/internal/resolver/directbuilder_test.go b/zrpc/internal/resolver/directbuilder_test.go similarity index 100% rename from rpcx/internal/resolver/directbuilder_test.go rename to zrpc/internal/resolver/directbuilder_test.go diff --git a/rpcx/internal/resolver/discovbuilder.go b/zrpc/internal/resolver/discovbuilder.go similarity index 100% rename from rpcx/internal/resolver/discovbuilder.go rename to zrpc/internal/resolver/discovbuilder.go diff --git a/rpcx/internal/resolver/resolver.go b/zrpc/internal/resolver/resolver.go similarity index 100% rename from rpcx/internal/resolver/resolver.go rename to zrpc/internal/resolver/resolver.go diff --git a/rpcx/internal/resolver/resolver_test.go b/zrpc/internal/resolver/resolver_test.go similarity index 100% rename from rpcx/internal/resolver/resolver_test.go rename to zrpc/internal/resolver/resolver_test.go diff --git a/rpcx/internal/resolver/subset.go b/zrpc/internal/resolver/subset.go similarity index 100% rename from rpcx/internal/resolver/subset.go rename to zrpc/internal/resolver/subset.go diff --git a/rpcx/internal/resolver/subset_test.go b/zrpc/internal/resolver/subset_test.go similarity index 100% rename from rpcx/internal/resolver/subset_test.go rename to zrpc/internal/resolver/subset_test.go diff --git a/rpcx/internal/rpclogger.go b/zrpc/internal/rpclogger.go similarity index 100% rename from rpcx/internal/rpclogger.go rename to zrpc/internal/rpclogger.go diff --git a/rpcx/internal/rpcpubserver.go b/zrpc/internal/rpcpubserver.go similarity index 100% rename from rpcx/internal/rpcpubserver.go rename to zrpc/internal/rpcpubserver.go diff --git a/rpcx/internal/rpcserver.go b/zrpc/internal/rpcserver.go similarity index 96% rename from rpcx/internal/rpcserver.go rename to zrpc/internal/rpcserver.go index 179f787d..15976c4c 100644 --- a/rpcx/internal/rpcserver.go +++ b/zrpc/internal/rpcserver.go @@ -5,7 +5,7 @@ import ( "github.com/tal-tech/go-zero/core/proc" "github.com/tal-tech/go-zero/core/stat" - "github.com/tal-tech/go-zero/rpcx/internal/serverinterceptors" + "github.com/tal-tech/go-zero/zrpc/internal/serverinterceptors" "google.golang.org/grpc" ) diff --git a/rpcx/internal/rpcserver_test.go b/zrpc/internal/rpcserver_test.go similarity index 100% rename from rpcx/internal/rpcserver_test.go rename to zrpc/internal/rpcserver_test.go diff --git a/rpcx/internal/server.go b/zrpc/internal/server.go similarity index 100% rename from rpcx/internal/server.go rename to zrpc/internal/server.go diff --git a/rpcx/internal/server_test.go b/zrpc/internal/server_test.go similarity index 100% rename from rpcx/internal/server_test.go rename to zrpc/internal/server_test.go diff --git a/rpcx/internal/serverinterceptors/authinterceptor.go b/zrpc/internal/serverinterceptors/authinterceptor.go similarity index 93% rename from rpcx/internal/serverinterceptors/authinterceptor.go rename to zrpc/internal/serverinterceptors/authinterceptor.go index 7cea029f..102cac34 100644 --- a/rpcx/internal/serverinterceptors/authinterceptor.go +++ b/zrpc/internal/serverinterceptors/authinterceptor.go @@ -3,7 +3,7 @@ package serverinterceptors import ( "context" - "github.com/tal-tech/go-zero/rpcx/internal/auth" + "github.com/tal-tech/go-zero/zrpc/internal/auth" "google.golang.org/grpc" ) diff --git a/rpcx/internal/serverinterceptors/authinterceptor_test.go b/zrpc/internal/serverinterceptors/authinterceptor_test.go similarity index 98% rename from rpcx/internal/serverinterceptors/authinterceptor_test.go rename to zrpc/internal/serverinterceptors/authinterceptor_test.go index 987e9194..cbcd6129 100644 --- a/rpcx/internal/serverinterceptors/authinterceptor_test.go +++ b/zrpc/internal/serverinterceptors/authinterceptor_test.go @@ -7,7 +7,7 @@ import ( "github.com/alicebob/miniredis" "github.com/stretchr/testify/assert" "github.com/tal-tech/go-zero/core/stores/redis" - "github.com/tal-tech/go-zero/rpcx/internal/auth" + "github.com/tal-tech/go-zero/zrpc/internal/auth" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) diff --git a/rpcx/internal/serverinterceptors/crashinterceptor.go b/zrpc/internal/serverinterceptors/crashinterceptor.go similarity index 100% rename from rpcx/internal/serverinterceptors/crashinterceptor.go rename to zrpc/internal/serverinterceptors/crashinterceptor.go diff --git a/rpcx/internal/serverinterceptors/crashinterceptor_test.go b/zrpc/internal/serverinterceptors/crashinterceptor_test.go similarity index 100% rename from rpcx/internal/serverinterceptors/crashinterceptor_test.go rename to zrpc/internal/serverinterceptors/crashinterceptor_test.go diff --git a/rpcx/internal/serverinterceptors/prommetricinterceptor.go b/zrpc/internal/serverinterceptors/prommetricinterceptor.go similarity index 100% rename from rpcx/internal/serverinterceptors/prommetricinterceptor.go rename to zrpc/internal/serverinterceptors/prommetricinterceptor.go diff --git a/rpcx/internal/serverinterceptors/prommetricinterceptor_test.go b/zrpc/internal/serverinterceptors/prommetricinterceptor_test.go similarity index 100% rename from rpcx/internal/serverinterceptors/prommetricinterceptor_test.go rename to zrpc/internal/serverinterceptors/prommetricinterceptor_test.go diff --git a/rpcx/internal/serverinterceptors/sheddinginterceptor.go b/zrpc/internal/serverinterceptors/sheddinginterceptor.go similarity index 100% rename from rpcx/internal/serverinterceptors/sheddinginterceptor.go rename to zrpc/internal/serverinterceptors/sheddinginterceptor.go diff --git a/rpcx/internal/serverinterceptors/sheddinginterceptor_test.go b/zrpc/internal/serverinterceptors/sheddinginterceptor_test.go similarity index 100% rename from rpcx/internal/serverinterceptors/sheddinginterceptor_test.go rename to zrpc/internal/serverinterceptors/sheddinginterceptor_test.go diff --git a/rpcx/internal/serverinterceptors/statinterceptor.go b/zrpc/internal/serverinterceptors/statinterceptor.go similarity index 100% rename from rpcx/internal/serverinterceptors/statinterceptor.go rename to zrpc/internal/serverinterceptors/statinterceptor.go diff --git a/rpcx/internal/serverinterceptors/statinterceptor_test.go b/zrpc/internal/serverinterceptors/statinterceptor_test.go similarity index 100% rename from rpcx/internal/serverinterceptors/statinterceptor_test.go rename to zrpc/internal/serverinterceptors/statinterceptor_test.go diff --git a/rpcx/internal/serverinterceptors/timeoutinterceptor.go b/zrpc/internal/serverinterceptors/timeoutinterceptor.go similarity index 100% rename from rpcx/internal/serverinterceptors/timeoutinterceptor.go rename to zrpc/internal/serverinterceptors/timeoutinterceptor.go diff --git a/rpcx/internal/serverinterceptors/timeoutinterceptor_test.go b/zrpc/internal/serverinterceptors/timeoutinterceptor_test.go similarity index 100% rename from rpcx/internal/serverinterceptors/timeoutinterceptor_test.go rename to zrpc/internal/serverinterceptors/timeoutinterceptor_test.go diff --git a/rpcx/internal/serverinterceptors/tracinginterceptor.go b/zrpc/internal/serverinterceptors/tracinginterceptor.go similarity index 100% rename from rpcx/internal/serverinterceptors/tracinginterceptor.go rename to zrpc/internal/serverinterceptors/tracinginterceptor.go diff --git a/rpcx/internal/serverinterceptors/tracinginterceptor_test.go b/zrpc/internal/serverinterceptors/tracinginterceptor_test.go similarity index 100% rename from rpcx/internal/serverinterceptors/tracinginterceptor_test.go rename to zrpc/internal/serverinterceptors/tracinginterceptor_test.go diff --git a/rpcx/internal/target.go b/zrpc/internal/target.go similarity index 87% rename from rpcx/internal/target.go rename to zrpc/internal/target.go index 0eafcc5d..ff979fa8 100644 --- a/rpcx/internal/target.go +++ b/zrpc/internal/target.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/tal-tech/go-zero/rpcx/internal/resolver" + "github.com/tal-tech/go-zero/zrpc/internal/resolver" ) func BuildDirectTarget(endpoints []string) string { diff --git a/rpcx/internal/target_test.go b/zrpc/internal/target_test.go similarity index 100% rename from rpcx/internal/target_test.go rename to zrpc/internal/target_test.go diff --git a/rpcx/proxy.go b/zrpc/proxy.go similarity index 91% rename from rpcx/proxy.go rename to zrpc/proxy.go index 89cacbe6..f7bc6f79 100644 --- a/rpcx/proxy.go +++ b/zrpc/proxy.go @@ -1,12 +1,12 @@ -package rpcx +package zrpc import ( "context" "sync" "github.com/tal-tech/go-zero/core/syncx" - "github.com/tal-tech/go-zero/rpcx/internal" - "github.com/tal-tech/go-zero/rpcx/internal/auth" + "github.com/tal-tech/go-zero/zrpc/internal" + "github.com/tal-tech/go-zero/zrpc/internal/auth" "google.golang.org/grpc" ) diff --git a/rpcx/proxy_test.go b/zrpc/proxy_test.go similarity index 96% rename from rpcx/proxy_test.go rename to zrpc/proxy_test.go index 5ac81928..51782db6 100644 --- a/rpcx/proxy_test.go +++ b/zrpc/proxy_test.go @@ -1,4 +1,4 @@ -package rpcx +package zrpc import ( "context" @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tal-tech/go-zero/rpcx/internal/mock" + "github.com/tal-tech/go-zero/zrpc/internal/mock" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/rpcx/server.go b/zrpc/server.go similarity index 94% rename from rpcx/server.go rename to zrpc/server.go index 040808bb..08582df7 100644 --- a/rpcx/server.go +++ b/zrpc/server.go @@ -1,4 +1,4 @@ -package rpcx +package zrpc import ( "log" @@ -10,9 +10,9 @@ import ( "github.com/tal-tech/go-zero/core/logx" "github.com/tal-tech/go-zero/core/netx" "github.com/tal-tech/go-zero/core/stat" - "github.com/tal-tech/go-zero/rpcx/internal" - "github.com/tal-tech/go-zero/rpcx/internal/auth" - "github.com/tal-tech/go-zero/rpcx/internal/serverinterceptors" + "github.com/tal-tech/go-zero/zrpc/internal" + "github.com/tal-tech/go-zero/zrpc/internal/auth" + "github.com/tal-tech/go-zero/zrpc/internal/serverinterceptors" ) const envPodIp = "POD_IP"