fix golint issues in zrpc (#531)

This commit is contained in:
Kevin Wan
2021-03-01 23:52:44 +08:00
committed by GitHub
parent dd393351cc
commit 51de0d0620
29 changed files with 108 additions and 13 deletions

View File

@@ -10,6 +10,7 @@ import (
"google.golang.org/grpc"
)
// A RpcProxy is a rpc proxy.
type RpcProxy struct {
backend string
clients map[string]Client
@@ -18,6 +19,7 @@ type RpcProxy struct {
lock sync.Mutex
}
// NewProxy returns a RpcProxy.
func NewProxy(backend string, opts ...internal.ClientOption) *RpcProxy {
return &RpcProxy{
backend: backend,
@@ -27,6 +29,7 @@ func NewProxy(backend string, opts ...internal.ClientOption) *RpcProxy {
}
}
// TakeConn returns a grpc.ClientConn.
func (p *RpcProxy) TakeConn(ctx context.Context) (*grpc.ClientConn, error) {
cred := auth.ParseCredential(ctx)
key := cred.App + "/" + cred.Token