support direct scheme on rpc resolver

This commit is contained in:
kevin
2020-08-18 18:36:44 +08:00
parent 0214161bfc
commit f03cfb0ff7
11 changed files with 170 additions and 134 deletions

View File

@@ -38,11 +38,11 @@ func (p *RpcProxy) TakeConn(ctx context.Context) (*grpc.ClientConn, error) {
return client, nil
}
client, err := NewClient(RpcClientConf{
Server: p.backend,
App: cred.App,
Token: cred.Token,
}, p.options...)
opts := append(p.options, WithDialOption(grpc.WithPerRPCCredentials(&auth.Credential{
App: cred.App,
Token: cred.Token,
})))
client, err := NewClientWithTarget(p.backend, opts...)
if err != nil {
return nil, err
}