refactor rpcx, export WithDialOption and WithTimeout

This commit is contained in:
kevin
2020-08-11 14:33:10 +08:00
parent 95226762ba
commit 08fa64d553
7 changed files with 27 additions and 20 deletions

View File

@@ -3,5 +3,5 @@ package svc
import "github.com/tal-tech/go-zero/rpcx"
type ServiceContext struct {
Client *rpcx.RpcClient
Client rpcx.Client
}

View File

@@ -3,5 +3,5 @@ package svc
import "github.com/tal-tech/go-zero/rpcx"
type ServiceContext struct {
Client *rpcx.RpcClient
Client rpcx.Client
}

View File

@@ -15,7 +15,7 @@ import (
var (
configFile = flag.String("f", "config.json", "the config file")
client *rpcx.RpcClient
client rpcx.Client
)
func handle(w http.ResponseWriter, r *http.Request) {

View File

@@ -20,11 +20,11 @@ type (
}
PortalServer struct {
userRpc *rpcx.RpcClient
userRpc rpcx.Client
}
)
func NewPortalServer(client *rpcx.RpcClient) *PortalServer {
func NewPortalServer(client rpcx.Client) *PortalServer {
return &PortalServer{
userRpc: client,
}