UNPKG

950 BTypeScriptView Raw
1export interface TcpSubchannelAddress {
2 port: number;
3 host: string;
4}
5export interface IpcSubchannelAddress {
6 path: string;
7}
8/**
9 * This represents a single backend address to connect to. This interface is a
10 * subset of net.SocketConnectOpts, i.e. the options described at
11 * https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener.
12 * Those are in turn a subset of the options that can be passed to http2.connect.
13 */
14export type SubchannelAddress = TcpSubchannelAddress | IpcSubchannelAddress;
15export declare function isTcpSubchannelAddress(address: SubchannelAddress): address is TcpSubchannelAddress;
16export declare function subchannelAddressEqual(address1?: SubchannelAddress, address2?: SubchannelAddress): boolean;
17export declare function subchannelAddressToString(address: SubchannelAddress): string;
18export declare function stringToSubchannelAddress(addressString: string, port?: number): SubchannelAddress;