mirror of https://github.com/grpc/grpc-node.git
Merge pull request #2793 from murgatroid99/grpc-js_server_call_get_host
grpc-js: Add `getHost` to surface server call classes
This commit is contained in:
commit
e13d5e7006
|
@ -37,6 +37,7 @@ export type ServerSurfaceCall = {
|
|||
sendMetadata(responseMetadata: Metadata): void;
|
||||
getDeadline(): Deadline;
|
||||
getPath(): string;
|
||||
getHost(): string;
|
||||
} & EventEmitter;
|
||||
|
||||
export type ServerUnaryCall<RequestType, ResponseType> = ServerSurfaceCall & {
|
||||
|
@ -109,6 +110,10 @@ export class ServerUnaryCallImpl<RequestType, ResponseType>
|
|||
getPath(): string {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
getHost(): string {
|
||||
return this.call.getHost();
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerReadableStreamImpl<RequestType, ResponseType>
|
||||
|
@ -145,6 +150,10 @@ export class ServerReadableStreamImpl<RequestType, ResponseType>
|
|||
getPath(): string {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
getHost(): string {
|
||||
return this.call.getHost();
|
||||
}
|
||||
}
|
||||
|
||||
export class ServerWritableStreamImpl<RequestType, ResponseType>
|
||||
|
@ -190,6 +199,10 @@ export class ServerWritableStreamImpl<RequestType, ResponseType>
|
|||
return this.path;
|
||||
}
|
||||
|
||||
getHost(): string {
|
||||
return this.call.getHost();
|
||||
}
|
||||
|
||||
_write(
|
||||
chunk: ResponseType,
|
||||
encoding: string,
|
||||
|
@ -259,6 +272,10 @@ export class ServerDuplexStreamImpl<RequestType, ResponseType>
|
|||
return this.path;
|
||||
}
|
||||
|
||||
getHost(): string {
|
||||
return this.call.getHost();
|
||||
}
|
||||
|
||||
_read(size: number) {
|
||||
this.call.startRead();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue