зеркало из https://github.com/microsoft/etcd3.git
fix(rpc): pass auth credentials into duplex streams
This commit is contained in:
Родитель
cd5f75796c
Коммит
834a3b50cc
|
@ -1,4 +1,6 @@
|
|||
--<%= getCommentPrefixing(`rpc ${name}(`) %>
|
||||
public <%= _.lowerFirst(name) %>(): Promise<IDuplexStream<<%= requestTsType %>, <%= responseTsType %>>> {
|
||||
return this.client.getConnection('<%= service %>').then(cnx => (<any> cnx.client).<%= _.lowerFirst(name) %>());
|
||||
return this.client
|
||||
.getConnection('<%= service %>')
|
||||
.then(({ client, metadata }) => (<any> client).<%= _.lowerFirst(name) %>(metadata));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import * as grpc from 'grpc';
|
|||
|
||||
export interface ICallable {
|
||||
exec(service: keyof typeof Services, method: string, params: object): Promise<any>;
|
||||
getConnection(service: keyof typeof Services): Promise<{ client: grpc.Client }>;
|
||||
getConnection(service: keyof typeof Services): Promise<{ client: grpc.Client, metadata: grpc.Metadata }>;
|
||||
}
|
||||
|
||||
export interface IResponseStream<T> {
|
||||
|
|
Загрузка…
Ссылка в новой задаче