142 lines
3.5 KiB
JavaScript
142 lines
3.5 KiB
JavaScript
/**
|
|
* @fileoverview gRPC-Web generated client stub for GreetingService
|
|
* @enhanceable
|
|
* @public
|
|
*/
|
|
|
|
// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-grpc-web v1.5.0
|
|
// protoc v0.0.0
|
|
// source: api/greeting/greeting.proto
|
|
|
|
|
|
/* eslint-disable */
|
|
// @ts-nocheck
|
|
|
|
|
|
|
|
const grpc = {};
|
|
grpc.web = require('grpc-web');
|
|
|
|
|
|
var google_api_annotations_pb = require('../../google/api/annotations_pb.js')
|
|
const proto = {};
|
|
proto.GreetingService = require('./greeting_pb.js');
|
|
|
|
/**
|
|
* @param {string} hostname
|
|
* @param {?Object} credentials
|
|
* @param {?grpc.web.ClientOptions} options
|
|
* @constructor
|
|
* @struct
|
|
* @final
|
|
*/
|
|
proto.GreetingService.GreetingServiceClient =
|
|
function(hostname, credentials, options) {
|
|
if (!options) options = {};
|
|
options.format = 'binary';
|
|
|
|
/**
|
|
* @private @const {!grpc.web.GrpcWebClientBase} The client
|
|
*/
|
|
this.client_ = new grpc.web.GrpcWebClientBase(options);
|
|
|
|
/**
|
|
* @private @const {string} The hostname
|
|
*/
|
|
this.hostname_ = hostname.replace(/\/+$/, '');
|
|
|
|
};
|
|
|
|
|
|
/**
|
|
* @param {string} hostname
|
|
* @param {?Object} credentials
|
|
* @param {?grpc.web.ClientOptions} options
|
|
* @constructor
|
|
* @struct
|
|
* @final
|
|
*/
|
|
proto.GreetingService.GreetingServicePromiseClient =
|
|
function(hostname, credentials, options) {
|
|
if (!options) options = {};
|
|
options.format = 'binary';
|
|
|
|
/**
|
|
* @private @const {!grpc.web.GrpcWebClientBase} The client
|
|
*/
|
|
this.client_ = new grpc.web.GrpcWebClientBase(options);
|
|
|
|
/**
|
|
* @private @const {string} The hostname
|
|
*/
|
|
this.hostname_ = hostname.replace(/\/+$/, '');
|
|
|
|
};
|
|
|
|
|
|
/**
|
|
* @const
|
|
* @type {!grpc.web.MethodDescriptor<
|
|
* !proto.GreetingService.HelloRequest,
|
|
* !proto.GreetingService.HelloResponse>}
|
|
*/
|
|
const methodDescriptor_GreetingService_Hello = new grpc.web.MethodDescriptor(
|
|
'/GreetingService.GreetingService/Hello',
|
|
grpc.web.MethodType.UNARY,
|
|
proto.GreetingService.HelloRequest,
|
|
proto.GreetingService.HelloResponse,
|
|
/**
|
|
* @param {!proto.GreetingService.HelloRequest} request
|
|
* @return {!Uint8Array}
|
|
*/
|
|
function(request) {
|
|
return request.serializeBinary();
|
|
},
|
|
proto.GreetingService.HelloResponse.deserializeBinary
|
|
);
|
|
|
|
|
|
/**
|
|
* @param {!proto.GreetingService.HelloRequest} request The
|
|
* request proto
|
|
* @param {?Object<string, string>} metadata User defined
|
|
* call metadata
|
|
* @param {function(?grpc.web.RpcError, ?proto.GreetingService.HelloResponse)}
|
|
* callback The callback function(error, response)
|
|
* @return {!grpc.web.ClientReadableStream<!proto.GreetingService.HelloResponse>|undefined}
|
|
* The XHR Node Readable Stream
|
|
*/
|
|
proto.GreetingService.GreetingServiceClient.prototype.hello =
|
|
function(request, metadata, callback) {
|
|
return this.client_.rpcCall(this.hostname_ +
|
|
'/GreetingService.GreetingService/Hello',
|
|
request,
|
|
metadata || {},
|
|
methodDescriptor_GreetingService_Hello,
|
|
callback);
|
|
};
|
|
|
|
|
|
/**
|
|
* @param {!proto.GreetingService.HelloRequest} request The
|
|
* request proto
|
|
* @param {?Object<string, string>=} metadata User defined
|
|
* call metadata
|
|
* @return {!Promise<!proto.GreetingService.HelloResponse>}
|
|
* Promise that resolves to the response
|
|
*/
|
|
proto.GreetingService.GreetingServicePromiseClient.prototype.hello =
|
|
function(request, metadata) {
|
|
return this.client_.unaryCall(this.hostname_ +
|
|
'/GreetingService.GreetingService/Hello',
|
|
request,
|
|
metadata || {},
|
|
methodDescriptor_GreetingService_Hello);
|
|
};
|
|
|
|
|
|
module.exports = proto.GreetingService;
|
|
|