@creditkarma/thrift-client
Version:
Thrift client library for NodeJS written in TypeScript.
25 lines (24 loc) • 1.29 kB
TypeScript
/// <reference types="node" />
import * as Core from '@creditkarma/thrift-server-core';
import { OptionsOfBufferResponseBody } from 'got';
import { IHttpConnectionOptions, IThriftClientFilter, IThriftClientFilterConfig, RequestOptions } from '../types';
export declare const DEFAULT_PATH: string;
export declare type HttpProtocol = 'http' | 'https';
export declare class HttpConnection extends Core.ThriftConnection<OptionsOfBufferResponseBody> {
protected readonly port: number;
protected readonly hostName: string;
protected readonly path: string;
protected readonly basePath: string;
protected readonly url: string;
protected readonly protocol: HttpProtocol;
protected readonly filters: Array<IThriftClientFilter<RequestOptions>>;
private readonly requestOptions;
private readonly serviceName;
private readonly withEndpointPerMethod;
private readonly gotImpl;
constructor({ hostName, port, path, https, transport, protocol, requestOptions, serviceName, withEndpointPerMethod, headerBlacklist, gotImpl, }: IHttpConnectionOptions);
register(...filters: Array<IThriftClientFilterConfig<RequestOptions>>): void;
send(dataToSend: Buffer, context?: RequestOptions): Promise<Buffer>;
private write;
private filtersForMethod;
}