rename rpcx to zrpc

This commit is contained in:
kevin
2020-09-18 11:41:52 +08:00
parent 26e16107ce
commit 0b1ee79d3a
110 changed files with 154 additions and 154 deletions

View File

@@ -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
}

View File

@@ -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)),
}
}

View File

@@ -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

View File

@@ -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 {

View File

@@ -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,
}