Skip to content

Commit

Permalink
rename rpcx to zrpc
Browse files Browse the repository at this point in the history
  • Loading branch information
kevwan committed Sep 18, 2020
1 parent 26e1610 commit 0b1ee79
Show file tree
Hide file tree
Showing 110 changed files with 154 additions and 154 deletions.
10 changes: 5 additions & 5 deletions doc/bookstore-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand All @@ -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
}
}
```
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions doc/bookstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@
```go
type Config struct {
rest.RestConf
Add rpcx.RpcClientConf // 手动代码
Check rpcx.RpcClientConf // 手动代码
Add zrpc.RpcClientConf // 手动代码
Check zrpc.RpcClientConf // 手动代码
}
```

Expand All @@ -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)), // 手动代码
}
}
```
Expand Down Expand Up @@ -477,7 +477,7 @@

```go
type Config struct {
rpcx.RpcServerConf
zrpc.RpcServerConf
DataSource string // 手动代码
Table string // 手动代码
Cache cache.CacheConf // 手动代码
Expand Down
6 changes: 3 additions & 3 deletions doc/goctl-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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)
Expand Down
6 changes: 3 additions & 3 deletions doc/shorturl-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
```

Expand All @@ -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
}
}
```
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/shorturl.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
```go
type Config struct {
rest.RestConf
Transform rpcx.RpcClientConf // 手动代码
Transform zrpc.RpcClientConf // 手动代码
}
```

Expand All @@ -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)), // 手动代码
}
}
```
Expand Down Expand Up @@ -405,7 +405,7 @@

```go
type Config struct {
rpcx.RpcServerConf
zrpc.RpcServerConf
DataSource string // 手动代码
Table string // 手动代码
Cache cache.CacheConf // 手动代码
Expand Down
8 changes: 4 additions & 4 deletions example/bookstore/api/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Add zrpc.RpcClientConf
Check zrpc.RpcClientConf
}
8 changes: 4 additions & 4 deletions example/bookstore/api/internal/svc/servicecontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)),
}
}
}
4 changes: 2 additions & 2 deletions example/bookstore/rpc/add/add.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/bookstore/rpc/add/adder/adder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/bookstore/rpc/add/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions example/bookstore/rpc/check/check.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/bookstore/rpc/check/checker/checker.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions example/bookstore/rpc/check/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions example/graceful/dns/api/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions example/graceful/dns/api/graceful.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions example/graceful/dns/api/svc/servicecontext.go
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 3 additions & 3 deletions example/graceful/dns/rpc/gracefulrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions example/graceful/etcd/api/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions example/graceful/etcd/api/etc/graceful-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Rpc": {
"Etcd": {
"Hosts": ["etcd.discov:2379"],
"Key": "rpcx"
"Key": "zrpc"
}
}
}
}
4 changes: 2 additions & 2 deletions example/graceful/etcd/api/graceful.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions example/graceful/etcd/api/svc/servicecontext.go
Original file line number Diff line number Diff line change
@@ -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
}
Loading

0 comments on commit 0b1ee79

Please sign in to comment.