Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: string; }) {
if (!options) options = {};
if (!credentials) credentials = {};
options['format'] = 'binary';
this.client_ = new grpcWeb.GrpcWebClientBase(options);
this.hostname_ = hostname;
this.credentials_ = credentials;
this.options_ = options;
}
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: string; }) {
if (!options) options = {};
if (!credentials) credentials = {};
options['format'] = 'text';
this.client_ = new grpcWeb.GrpcWebClientBase(options);
this.hostname_ = hostname;
this.credentials_ = credentials;
this.options_ = options;
}
constructor(
private settings: GrpcClientSettings,
) {
this.client = new GrpcWebClientBase(this.settings);
}
constructor (hostname: string,
credentials?: null | { [index: string]: string; },
options?: null | { [index: string]: string; }) {
if (!options) options = {};
if (!credentials) credentials = {};
options['format'] = 'text';
this.client_ = new grpcWeb.GrpcWebClientBase(options);
this.hostname_ = hostname;
this.credentials_ = credentials;
this.options_ = options;
}
export const rpcWithHostname = hostname => {
const client = new grpc.GrpcWebClientBase()
return {
onStatus: callback => client.on('status', callback),
unaryCall: unary(client, hostname),
streamCall: stream(client, hostname),
}
}