@creditkarma/thrift-server-hapi
Version:
A Hapi server plugin for the Apache Thrift protocol
27 lines (26 loc) • 1.09 kB
TypeScript
import * as Hapi from '@hapi/hapi';
import { IThriftProcessor, IThriftServerOptions, ProtocolType, TransportType } from '@creditkarma/thrift-server-core';
export interface IServiceDetails {
processor: IThriftProcessor<Hapi.Request>;
}
export interface IServiceDetailMap {
[serviceName: string]: IServerDetails;
}
export interface IServerDetails {
transport: TransportType;
protocol: ProtocolType;
services: IServiceDetailMap;
}
export interface IHandlerOptions<TProcessor> {
service: TProcessor;
}
export declare type IHapiServerOptions<TProcessor extends IThriftProcessor<Hapi.Request>> = IThriftServerOptions<Hapi.Request, TProcessor>;
export interface IHapiPluginOptions<TProcessor extends IThriftProcessor<Hapi.Request>> {
path?: string;
auth?: false | string | Hapi.RouteOptionsAccess;
thriftOptions: IHapiServerOptions<TProcessor>;
}
export interface ICreateHapiServerOptions<TProcessor extends IThriftProcessor<Hapi.Request>> extends IHapiPluginOptions<TProcessor> {
port: number;
}
export declare type ThriftHapiPlugin = Hapi.Plugin<void>;