Skip to content

Commit 0b1ee79

Browse files
committed
rename rpcx to zrpc
1 parent 26e1610 commit 0b1ee79

File tree

110 files changed

+154
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+154
-154
lines changed

doc/bookstore-en.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ you can change the listening port in file `etc/add.yaml`.
347347
```go
348348
type Config struct {
349349
rest.RestConf
350-
Add rpcx.RpcClientConf // manual code
351-
Check rpcx.RpcClientConf // manual code
350+
Add zrpc.RpcClientConf // manual code
351+
Check zrpc.RpcClientConf // manual code
352352
}
353353
```
354354

@@ -364,8 +364,8 @@ you can change the listening port in file `etc/add.yaml`.
364364
func NewServiceContext(c config.Config) *ServiceContext {
365365
return &ServiceContext{
366366
Config: c,
367-
Adder: adder.NewAdder(rpcx.MustNewClient(c.Add)), // manual code
368-
Checker: checker.NewChecker(rpcx.MustNewClient(c.Check)), // manual code
367+
Adder: adder.NewAdder(zrpc.MustNewClient(c.Add)), // manual code
368+
Checker: checker.NewChecker(zrpc.MustNewClient(c.Check)), // manual code
369369
}
370370
}
371371
```
@@ -477,7 +477,7 @@ Till now, we’ve done the modification of API Gateway. All the manually added c
477477

478478
```go
479479
type Config struct {
480-
rpcx.RpcServerConf
480+
zrpc.RpcServerConf
481481
DataSource string // manual code
482482
Table string // manual code
483483
Cache cache.CacheConf // manual code

doc/bookstore.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@
349349
```go
350350
type Config struct {
351351
rest.RestConf
352-
Add rpcx.RpcClientConf // 手动代码
353-
Check rpcx.RpcClientConf // 手动代码
352+
Add zrpc.RpcClientConf // 手动代码
353+
Check zrpc.RpcClientConf // 手动代码
354354
}
355355
```
356356

@@ -366,8 +366,8 @@
366366
func NewServiceContext(c config.Config) *ServiceContext {
367367
return &ServiceContext{
368368
Config: c,
369-
Adder: adder.NewAdder(rpcx.MustNewClient(c.Add)), // 手动代码
370-
Checker: checker.NewChecker(rpcx.MustNewClient(c.Check)), // 手动代码
369+
Adder: adder.NewAdder(zrpc.MustNewClient(c.Add)), // 手动代码
370+
Checker: checker.NewChecker(zrpc.MustNewClient(c.Check)), // 手动代码
371371
}
372372
}
373373
```
@@ -477,7 +477,7 @@
477477

478478
```go
479479
type Config struct {
480-
rpcx.RpcServerConf
480+
zrpc.RpcServerConf
481481
DataSource string // 手动代码
482482
Table string // 手动代码
483483
Cache cache.CacheConf // 手动代码

doc/goctl-rpc.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ OPTIONS:
221221
*rrBalanced does not implement Picker (wrong type for Pick method)
222222
have Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error)
223223
want Pick(balancer.PickInfo) (balancer.PickResult, error)
224-
#github.com/tal-tech/go-zero/rpcx/internal/balancer/p2c
225-
../../../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
224+
#github.com/tal-tech/go-zero/zrpc/internal/balancer/p2c
225+
../../../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
226226
have (string, *p2cPickerBuilder)
227227
want (string, base.PickerBuilder, base.Config)
228-
../../../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:
228+
../../../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:
229229
*p2cPicker does not implement balancer.Picker (wrong type for Pick method)
230230
have Pick(context.Context, balancer.PickInfo) (balancer.SubConn, func(balancer.DoneInfo), error)
231231
want Pick(balancer.PickInfo) (balancer.PickResult, error)

doc/shorturl-en.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ And now, let’s walk through the complete flow of quickly create a microservice
284284
```go
285285
type Config struct {
286286
rest.RestConf
287-
Transform rpcx.RpcClientConf // manual code
287+
Transform zrpc.RpcClientConf // manual code
288288
}
289289
```
290290

@@ -299,7 +299,7 @@ And now, let’s walk through the complete flow of quickly create a microservice
299299
func NewServiceContext(c config.Config) *ServiceContext {
300300
return &ServiceContext{
301301
Config: c,
302-
Transformer: transformer.NewTransformer(rpcx.MustNewClient(c.Transform)), // manual code
302+
Transformer: transformer.NewTransformer(zrpc.MustNewClient(c.Transform)), // manual code
303303
}
304304
}
305305
```
@@ -409,7 +409,7 @@ Till now, we’ve done the modification of API Gateway. All the manually added c
409409

410410
```go
411411
type Config struct {
412-
rpcx.RpcServerConf
412+
zrpc.RpcServerConf
413413
DataSource string // manual code
414414
Table string // manual code
415415
Cache cache.CacheConf // manual code

doc/shorturl.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
```go
281281
type Config struct {
282282
rest.RestConf
283-
Transform rpcx.RpcClientConf // 手动代码
283+
Transform zrpc.RpcClientConf // 手动代码
284284
}
285285
```
286286

@@ -295,7 +295,7 @@
295295
func NewServiceContext(c config.Config) *ServiceContext {
296296
return &ServiceContext{
297297
Config: c,
298-
Transformer: transformer.NewTransformer(rpcx.MustNewClient(c.Transform)), // 手动代码
298+
Transformer: transformer.NewTransformer(zrpc.MustNewClient(c.Transform)), // 手动代码
299299
}
300300
}
301301
```
@@ -405,7 +405,7 @@
405405

406406
```go
407407
type Config struct {
408-
rpcx.RpcServerConf
408+
zrpc.RpcServerConf
409409
DataSource string // 手动代码
410410
Table string // 手动代码
411411
Cache cache.CacheConf // 手动代码

example/bookstore/api/internal/config/config.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package config
22

33
import (
44
"github.com/tal-tech/go-zero/rest"
5-
"github.com/tal-tech/go-zero/rpcx"
5+
"github.com/tal-tech/go-zero/zrpc"
66
)
77

88
type Config struct {
99
rest.RestConf
10-
Add rpcx.RpcClientConf
11-
Check rpcx.RpcClientConf
12-
}
10+
Add zrpc.RpcClientConf
11+
Check zrpc.RpcClientConf
12+
}

example/bookstore/api/internal/svc/servicecontext.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"bookstore/rpc/add/adder"
66
"bookstore/rpc/check/checker"
77

8-
"github.com/tal-tech/go-zero/rpcx"
8+
"github.com/tal-tech/go-zero/zrpc"
99
)
1010

1111
type ServiceContext struct {
@@ -17,7 +17,7 @@ type ServiceContext struct {
1717
func NewServiceContext(c config.Config) *ServiceContext {
1818
return &ServiceContext{
1919
Config: c,
20-
Adder: adder.NewAdder(rpcx.MustNewClient(c.Add)),
21-
Checker: checker.NewChecker(rpcx.MustNewClient(c.Check)),
20+
Adder: adder.NewAdder(zrpc.MustNewClient(c.Add)),
21+
Checker: checker.NewChecker(zrpc.MustNewClient(c.Check)),
2222
}
23-
}
23+
}

example/bookstore/rpc/add/add.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/bookstore/rpc/add/adder/adder.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/bookstore/rpc/add/internal/config/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package config
22

33
import (
44
"github.com/tal-tech/go-zero/core/stores/cache"
5-
"github.com/tal-tech/go-zero/rpcx"
5+
"github.com/tal-tech/go-zero/zrpc"
66
)
77

88
type Config struct {
9-
rpcx.RpcServerConf
9+
zrpc.RpcServerConf
1010
DataSource string
1111
Table string
1212
Cache cache.CacheConf
13-
}
13+
}

example/bookstore/rpc/check/check.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/bookstore/rpc/check/checker/checker.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/bookstore/rpc/check/internal/config/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package config
22

33
import (
44
"github.com/tal-tech/go-zero/core/stores/cache"
5-
"github.com/tal-tech/go-zero/rpcx"
5+
"github.com/tal-tech/go-zero/zrpc"
66
)
77

88
type Config struct {
9-
rpcx.RpcServerConf
9+
zrpc.RpcServerConf
1010
DataSource string
1111
Table string
1212
Cache cache.CacheConf
13-
}
13+
}

example/graceful/dns/api/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package config
22

33
import (
44
"github.com/tal-tech/go-zero/rest"
5-
"github.com/tal-tech/go-zero/rpcx"
5+
"github.com/tal-tech/go-zero/zrpc"
66
)
77

88
type Config struct {
99
rest.RestConf
10-
Rpc rpcx.RpcClientConf
10+
Rpc zrpc.RpcClientConf
1111
}

example/graceful/dns/api/graceful.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/tal-tech/go-zero/example/graceful/dns/api/handler"
99
"github.com/tal-tech/go-zero/example/graceful/dns/api/svc"
1010
"github.com/tal-tech/go-zero/rest"
11-
"github.com/tal-tech/go-zero/rpcx"
11+
"github.com/tal-tech/go-zero/zrpc"
1212
)
1313

1414
var configFile = flag.String("f", "etc/graceful-api.json", "the config file")
@@ -19,7 +19,7 @@ func main() {
1919
var c config.Config
2020
conf.MustLoad(*configFile, &c)
2121

22-
client := rpcx.MustNewClient(c.Rpc)
22+
client := zrpc.MustNewClient(c.Rpc)
2323
ctx := &svc.ServiceContext{
2424
Client: client,
2525
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package svc
22

3-
import "github.com/tal-tech/go-zero/rpcx"
3+
import "github.com/tal-tech/go-zero/zrpc"
44

55
type ServiceContext struct {
6-
Client rpcx.Client
6+
Client zrpc.Client
77
}

example/graceful/dns/rpc/gracefulrpc.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
"github.com/tal-tech/go-zero/core/conf"
1111
"github.com/tal-tech/go-zero/example/graceful/dns/rpc/graceful"
12-
"github.com/tal-tech/go-zero/rpcx"
12+
"github.com/tal-tech/go-zero/zrpc"
1313
"google.golang.org/grpc"
1414
)
1515

@@ -39,10 +39,10 @@ func (gs *GracefulServer) Grace(ctx context.Context, req *graceful.Request) (*gr
3939
func main() {
4040
flag.Parse()
4141

42-
var c rpcx.RpcServerConf
42+
var c zrpc.RpcServerConf
4343
conf.MustLoad(*configFile, &c)
4444

45-
server := rpcx.MustNewServer(c, func(grpcServer *grpc.Server) {
45+
server := zrpc.MustNewServer(c, func(grpcServer *grpc.Server) {
4646
graceful.RegisterGraceServiceServer(grpcServer, NewGracefulServer())
4747
})
4848
defer server.Stop()

example/graceful/etcd/api/config/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package config
22

33
import (
44
"github.com/tal-tech/go-zero/rest"
5-
"github.com/tal-tech/go-zero/rpcx"
5+
"github.com/tal-tech/go-zero/zrpc"
66
)
77

88
type Config struct {
99
rest.RestConf
10-
Rpc rpcx.RpcClientConf
10+
Rpc zrpc.RpcClientConf
1111
}

example/graceful/etcd/api/etc/graceful-api.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Rpc": {
77
"Etcd": {
88
"Hosts": ["etcd.discov:2379"],
9-
"Key": "rpcx"
9+
"Key": "zrpc"
1010
}
1111
}
12-
}
12+
}

example/graceful/etcd/api/graceful.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/tal-tech/go-zero/example/graceful/etcd/api/handler"
99
"github.com/tal-tech/go-zero/example/graceful/etcd/api/svc"
1010
"github.com/tal-tech/go-zero/rest"
11-
"github.com/tal-tech/go-zero/rpcx"
11+
"github.com/tal-tech/go-zero/zrpc"
1212
)
1313

1414
var configFile = flag.String("f", "etc/graceful-api.json", "the config file")
@@ -19,7 +19,7 @@ func main() {
1919
var c config.Config
2020
conf.MustLoad(*configFile, &c)
2121

22-
client := rpcx.MustNewClient(c.Rpc)
22+
client := zrpc.MustNewClient(c.Rpc)
2323
ctx := &svc.ServiceContext{
2424
Client: client,
2525
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package svc
22

3-
import "github.com/tal-tech/go-zero/rpcx"
3+
import "github.com/tal-tech/go-zero/zrpc"
44

55
type ServiceContext struct {
6-
Client rpcx.Client
6+
Client zrpc.Client
77
}

0 commit comments

Comments
 (0)