@minimaltech/node-infra
Version:
Minimal Technology NodeJS Infrastructure - Loopback 4 Framework
32 lines (31 loc) • 923 B
TypeScript
import { Client, ServerOptions, ServerCredentials, ChannelCredentials } from '@grpc/grpc-js';
import { Constructor, ValueOrPromise } from '@loopback/core';
export interface IGrpcServerOptions {
identifier: string;
serverOptions?: ServerOptions;
protoFolder: string;
address: string | number;
credentials?: ServerCredentials;
}
export interface IGrpcController {
}
export interface IGrpcControllerOptions {
}
export interface IGrpcMethodOptions {
proto: string;
service: string;
method?: string;
isRequestStream?: boolean;
isResponseStream?: boolean;
}
export type TGrpcServiceClient = Client;
export interface IGrpcClientOptions<S extends Client> {
identifier: string;
serviceClass: Constructor<S>;
address: string | number;
credentials: ChannelCredentials;
autoConnect?: boolean;
onClientReady?: (opts: {
client: S;
}) => ValueOrPromise<void>;
}