Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ build
/protoc-gen-swiftgrpc
third_party/**
/Echo
/EchoNIO
/test.out
/echo.pid
/SwiftGRPC.xcodeproj
Package.resolved
Examples/EchoWeb/dist
Examples/EchoWeb/node_modules
Examples/EchoWeb/package-lock.json
181 changes: 181 additions & 0 deletions Examples/EchoWeb/Generated/echo_grpc_web_pb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
/**
* @fileoverview gRPC-Web generated client stub for echo
* @enhanceable
* @public
*/

// GENERATED CODE -- DO NOT EDIT!



const grpc = {};
grpc.web = require('grpc-web');

const proto = {};
proto.echo = require('./echo_pb.js');

/**
* @param {string} hostname
* @param {?Object} credentials
* @param {?Object} options
* @constructor
* @struct
* @final
*/
proto.echo.EchoClient =
function(hostname, credentials, options) {
if (!options) options = {};
options['format'] = 'text';

/**
* @private @const {!grpc.web.GrpcWebClientBase} The client
*/
this.client_ = new grpc.web.GrpcWebClientBase(options);

/**
* @private @const {string} The hostname
*/
this.hostname_ = hostname;

/**
* @private @const {?Object} The credentials to be used to connect
* to the server
*/
this.credentials_ = credentials;

/**
* @private @const {?Object} Options for the client
*/
this.options_ = options;
};


/**
* @param {string} hostname
* @param {?Object} credentials
* @param {?Object} options
* @constructor
* @struct
* @final
*/
proto.echo.EchoPromiseClient =
function(hostname, credentials, options) {
if (!options) options = {};
options['format'] = 'text';

/**
* @private @const {!proto.echo.EchoClient} The delegate callback based client
*/
this.delegateClient_ = new proto.echo.EchoClient(
hostname, credentials, options);

};


/**
* @const
* @type {!grpc.web.AbstractClientBase.MethodInfo<
* !proto.echo.EchoRequest,
* !proto.echo.EchoResponse>}
*/
const methodInfo_Echo_Get = new grpc.web.AbstractClientBase.MethodInfo(
proto.echo.EchoResponse,
/** @param {!proto.echo.EchoRequest} request */
function(request) {
return request.serializeBinary();
},
proto.echo.EchoResponse.deserializeBinary
);


/**
* @param {!proto.echo.EchoRequest} request The
* request proto
* @param {!Object<string, string>} metadata User defined
* call metadata
* @param {function(?grpc.web.Error, ?proto.echo.EchoResponse)}
* callback The callback function(error, response)
* @return {!grpc.web.ClientReadableStream<!proto.echo.EchoResponse>|undefined}
* The XHR Node Readable Stream
*/
proto.echo.EchoClient.prototype.get =
function(request, metadata, callback) {
return this.client_.rpcCall(this.hostname_ +
'/echo.Echo/Get',
request,
metadata,
methodInfo_Echo_Get,
callback);
};


/**
* @param {!proto.echo.EchoRequest} request The
* request proto
* @param {!Object<string, string>} metadata User defined
* call metadata
* @return {!Promise<!proto.echo.EchoResponse>}
* The XHR Node Readable Stream
*/
proto.echo.EchoPromiseClient.prototype.get =
function(request, metadata) {
return new Promise((resolve, reject) => {
this.delegateClient_.get(
request, metadata, (error, response) => {
error ? reject(error) : resolve(response);
});
});
};


/**
* @const
* @type {!grpc.web.AbstractClientBase.MethodInfo<
* !proto.echo.EchoRequest,
* !proto.echo.EchoResponse>}
*/
const methodInfo_Echo_Expand = new grpc.web.AbstractClientBase.MethodInfo(
proto.echo.EchoResponse,
/** @param {!proto.echo.EchoRequest} request */
function(request) {
return request.serializeBinary();
},
proto.echo.EchoResponse.deserializeBinary
);


/**
* @param {!proto.echo.EchoRequest} request The request proto
* @param {!Object<string, string>} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.echo.EchoResponse>}
* The XHR Node Readable Stream
*/
proto.echo.EchoClient.prototype.expand =
function(request, metadata) {
return this.client_.serverStreaming(this.hostname_ +
'/echo.Echo/Expand',
request,
metadata,
methodInfo_Echo_Expand);
};


/**
* @param {!proto.echo.EchoRequest} request The request proto
* @param {!Object<string, string>} metadata User defined
* call metadata
* @return {!grpc.web.ClientReadableStream<!proto.echo.EchoResponse>}
* The XHR Node Readable Stream
*/
proto.echo.EchoPromiseClient.prototype.expand =
function(request, metadata) {
return this.delegateClient_.client_.serverStreaming(this.delegateClient_.hostname_ +
'/echo.Echo/Expand',
request,
metadata,
methodInfo_Echo_Expand);
};


module.exports = proto.echo;
Loading