parent
f8d7747ddd
commit
18997430dd
9 changed files with 1068 additions and 65 deletions
@ -0,0 +1 @@ |
||||
**/*_pb.js |
@ -1,28 +0,0 @@ |
||||
{ |
||||
"bitwise": true, |
||||
"curly": true, |
||||
"eqeqeq": true, |
||||
"esnext": true, |
||||
"freeze": true, |
||||
"immed": true, |
||||
"indent": 2, |
||||
"latedef": "nofunc", |
||||
"maxlen": 80, |
||||
"newcap": true, |
||||
"node": true, |
||||
"noarg": true, |
||||
"quotmark": "single", |
||||
"strict": true, |
||||
"trailing": true, |
||||
"undef": true, |
||||
"unused": "vars", |
||||
"globals": { |
||||
/* Mocha-provided globals */ |
||||
"describe": false, |
||||
"it": false, |
||||
"before": false, |
||||
"beforeEach": false, |
||||
"after": false, |
||||
"afterEach": false |
||||
} |
||||
} |
@ -0,0 +1,99 @@ |
||||
// GENERATED CODE -- DO NOT EDIT!
|
||||
|
||||
'use strict'; |
||||
var grpc = require('grpc'); |
||||
var math_pb = require('./math_pb.js'); |
||||
|
||||
function serialize_DivArgs(arg) { |
||||
if (!(arg instanceof math_pb.DivArgs)) { |
||||
throw new Error('Expected argument of type DivArgs'); |
||||
} |
||||
return new Buffer(arg.serializeBinary()); |
||||
} |
||||
|
||||
function deserialize_DivArgs(buffer_arg) { |
||||
return math_pb.DivArgs.deserializeBinary(new Uint8Array(buffer_arg)); |
||||
} |
||||
|
||||
function serialize_DivReply(arg) { |
||||
if (!(arg instanceof math_pb.DivReply)) { |
||||
throw new Error('Expected argument of type DivReply'); |
||||
} |
||||
return new Buffer(arg.serializeBinary()); |
||||
} |
||||
|
||||
function deserialize_DivReply(buffer_arg) { |
||||
return math_pb.DivReply.deserializeBinary(new Uint8Array(buffer_arg)); |
||||
} |
||||
|
||||
function serialize_FibArgs(arg) { |
||||
if (!(arg instanceof math_pb.FibArgs)) { |
||||
throw new Error('Expected argument of type FibArgs'); |
||||
} |
||||
return new Buffer(arg.serializeBinary()); |
||||
} |
||||
|
||||
function deserialize_FibArgs(buffer_arg) { |
||||
return math_pb.FibArgs.deserializeBinary(new Uint8Array(buffer_arg)); |
||||
} |
||||
|
||||
function serialize_Num(arg) { |
||||
if (!(arg instanceof math_pb.Num)) { |
||||
throw new Error('Expected argument of type Num'); |
||||
} |
||||
return new Buffer(arg.serializeBinary()); |
||||
} |
||||
|
||||
function deserialize_Num(buffer_arg) { |
||||
return math_pb.Num.deserializeBinary(new Uint8Array(buffer_arg)); |
||||
} |
||||
|
||||
|
||||
var MathService = exports.MathService = { |
||||
div: { |
||||
path: '/math.Math/Div', |
||||
requestStream: false, |
||||
responseStream: false, |
||||
requestType: math_pb.DivArgs, |
||||
responseType: math_pb.DivReply, |
||||
requestSerialize: serialize_DivArgs, |
||||
requestDeserialize: deserialize_DivArgs, |
||||
responseSerialize: serialize_DivReply, |
||||
responseDeserialize: deserialize_DivReply, |
||||
}, |
||||
divMany: { |
||||
path: '/math.Math/DivMany', |
||||
requestStream: true, |
||||
responseStream: true, |
||||
requestType: math_pb.DivArgs, |
||||
responseType: math_pb.DivReply, |
||||
requestSerialize: serialize_DivArgs, |
||||
requestDeserialize: deserialize_DivArgs, |
||||
responseSerialize: serialize_DivReply, |
||||
responseDeserialize: deserialize_DivReply, |
||||
}, |
||||
fib: { |
||||
path: '/math.Math/Fib', |
||||
requestStream: false, |
||||
responseStream: true, |
||||
requestType: math_pb.FibArgs, |
||||
responseType: math_pb.Num, |
||||
requestSerialize: serialize_FibArgs, |
||||
requestDeserialize: deserialize_FibArgs, |
||||
responseSerialize: serialize_Num, |
||||
responseDeserialize: deserialize_Num, |
||||
}, |
||||
sum: { |
||||
path: '/math.Math/Sum', |
||||
requestStream: true, |
||||
responseStream: false, |
||||
requestType: math_pb.Num, |
||||
responseType: math_pb.Num, |
||||
requestSerialize: serialize_Num, |
||||
requestDeserialize: deserialize_Num, |
||||
responseSerialize: serialize_Num, |
||||
responseDeserialize: deserialize_Num, |
||||
}, |
||||
}; |
||||
|
||||
exports.MathClient = grpc.makeGenericClientConstructor(MathService); |
@ -0,0 +1,866 @@ |
||||
/** |
||||
* @fileoverview |
||||
* @enhanceable |
||||
* @public |
||||
*/ |
||||
// GENERATED CODE -- DO NOT EDIT!
|
||||
|
||||
var jspb = require('google-protobuf'); |
||||
var goog = jspb; |
||||
var global = Function('return this')(); |
||||
|
||||
goog.exportSymbol('proto.math.DivArgs', null, global); |
||||
goog.exportSymbol('proto.math.DivReply', null, global); |
||||
goog.exportSymbol('proto.math.FibArgs', null, global); |
||||
goog.exportSymbol('proto.math.FibReply', null, global); |
||||
goog.exportSymbol('proto.math.Num', null, global); |
||||
|
||||
/** |
||||
* Generated by JsPbCodeGenerator. |
||||
* @param {Array=} opt_data Optional initial data array, typically from a |
||||
* server response, or constructed directly in Javascript. The array is used |
||||
* in place and becomes part of the constructed object. It is not cloned. |
||||
* If no data is provided, the constructed object will be empty, but still |
||||
* valid. |
||||
* @extends {jspb.Message} |
||||
* @constructor |
||||
*/ |
||||
proto.math.DivArgs = function(opt_data) { |
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
||||
}; |
||||
goog.inherits(proto.math.DivArgs, jspb.Message); |
||||
if (goog.DEBUG && !COMPILED) { |
||||
proto.math.DivArgs.displayName = 'proto.math.DivArgs'; |
||||
} |
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) { |
||||
/** |
||||
* Creates an object representation of this proto suitable for use in Soy templates. |
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. |
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
||||
* For the list of reserved names please see: |
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.DivArgs.prototype.toObject = function(opt_includeInstance) { |
||||
return proto.math.DivArgs.toObject(opt_includeInstance, this); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Static version of the {@see toObject} method. |
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB |
||||
* instance for transitional soy proto support: |
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.math.DivArgs} msg The msg instance to transform. |
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.DivArgs.toObject = function(includeInstance, msg) { |
||||
var f, obj = { |
||||
dividend: msg.getDividend(), |
||||
divisor: msg.getDivisor() |
||||
}; |
||||
|
||||
if (includeInstance) { |
||||
obj.$jspbMessageInstance = msg |
||||
} |
||||
return obj; |
||||
}; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format). |
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. |
||||
* @return {!proto.math.DivArgs} |
||||
*/ |
||||
proto.math.DivArgs.deserializeBinary = function(bytes) { |
||||
var reader = new jspb.BinaryReader(bytes); |
||||
var msg = new proto.math.DivArgs; |
||||
return proto.math.DivArgs.deserializeBinaryFromReader(msg, reader); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format) from the |
||||
* given reader into the given message object. |
||||
* @param {!proto.math.DivArgs} msg The message object to deserialize into. |
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. |
||||
* @return {!proto.math.DivArgs} |
||||
*/ |
||||
proto.math.DivArgs.deserializeBinaryFromReader = function(msg, reader) { |
||||
while (reader.nextField()) { |
||||
if (reader.isEndGroup()) { |
||||
break; |
||||
} |
||||
var field = reader.getFieldNumber(); |
||||
switch (field) { |
||||
case 1: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setDividend(value); |
||||
break; |
||||
case 2: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setDivisor(value); |
||||
break; |
||||
default: |
||||
reader.skipField(); |
||||
break; |
||||
} |
||||
} |
||||
return msg; |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Class method variant: serializes the given message to binary data |
||||
* (in protobuf wire format), writing to the given BinaryWriter. |
||||
* @param {!proto.math.DivArgs} message |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.DivArgs.serializeBinaryToWriter = function(message, writer) { |
||||
message.serializeBinaryToWriter(writer); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format). |
||||
* @return {!Uint8Array} |
||||
*/ |
||||
proto.math.DivArgs.prototype.serializeBinary = function() { |
||||
var writer = new jspb.BinaryWriter(); |
||||
this.serializeBinaryToWriter(writer); |
||||
return writer.getResultBuffer(); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format), |
||||
* writing to the given BinaryWriter. |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.DivArgs.prototype.serializeBinaryToWriter = function (writer) { |
||||
var f = undefined; |
||||
f = this.getDividend(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
1, |
||||
f |
||||
); |
||||
} |
||||
f = this.getDivisor(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
2, |
||||
f |
||||
); |
||||
} |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Creates a deep clone of this proto. No data is shared with the original. |
||||
* @return {!proto.math.DivArgs} The clone. |
||||
*/ |
||||
proto.math.DivArgs.prototype.cloneMessage = function() { |
||||
return /** @type {!proto.math.DivArgs} */ (jspb.Message.cloneMessage(this)); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 dividend = 1; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.DivArgs.prototype.getDividend = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.DivArgs.prototype.setDividend = function(value) { |
||||
jspb.Message.setField(this, 1, value); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 divisor = 2; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.DivArgs.prototype.getDivisor = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.DivArgs.prototype.setDivisor = function(value) { |
||||
jspb.Message.setField(this, 2, value); |
||||
}; |
||||
|
||||
|
||||
|
||||
/** |
||||
* Generated by JsPbCodeGenerator. |
||||
* @param {Array=} opt_data Optional initial data array, typically from a |
||||
* server response, or constructed directly in Javascript. The array is used |
||||
* in place and becomes part of the constructed object. It is not cloned. |
||||
* If no data is provided, the constructed object will be empty, but still |
||||
* valid. |
||||
* @extends {jspb.Message} |
||||
* @constructor |
||||
*/ |
||||
proto.math.DivReply = function(opt_data) { |
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
||||
}; |
||||
goog.inherits(proto.math.DivReply, jspb.Message); |
||||
if (goog.DEBUG && !COMPILED) { |
||||
proto.math.DivReply.displayName = 'proto.math.DivReply'; |
||||
} |
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) { |
||||
/** |
||||
* Creates an object representation of this proto suitable for use in Soy templates. |
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. |
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
||||
* For the list of reserved names please see: |
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.DivReply.prototype.toObject = function(opt_includeInstance) { |
||||
return proto.math.DivReply.toObject(opt_includeInstance, this); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Static version of the {@see toObject} method. |
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB |
||||
* instance for transitional soy proto support: |
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.math.DivReply} msg The msg instance to transform. |
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.DivReply.toObject = function(includeInstance, msg) { |
||||
var f, obj = { |
||||
quotient: msg.getQuotient(), |
||||
remainder: msg.getRemainder() |
||||
}; |
||||
|
||||
if (includeInstance) { |
||||
obj.$jspbMessageInstance = msg |
||||
} |
||||
return obj; |
||||
}; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format). |
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. |
||||
* @return {!proto.math.DivReply} |
||||
*/ |
||||
proto.math.DivReply.deserializeBinary = function(bytes) { |
||||
var reader = new jspb.BinaryReader(bytes); |
||||
var msg = new proto.math.DivReply; |
||||
return proto.math.DivReply.deserializeBinaryFromReader(msg, reader); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format) from the |
||||
* given reader into the given message object. |
||||
* @param {!proto.math.DivReply} msg The message object to deserialize into. |
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. |
||||
* @return {!proto.math.DivReply} |
||||
*/ |
||||
proto.math.DivReply.deserializeBinaryFromReader = function(msg, reader) { |
||||
while (reader.nextField()) { |
||||
if (reader.isEndGroup()) { |
||||
break; |
||||
} |
||||
var field = reader.getFieldNumber(); |
||||
switch (field) { |
||||
case 1: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setQuotient(value); |
||||
break; |
||||
case 2: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setRemainder(value); |
||||
break; |
||||
default: |
||||
reader.skipField(); |
||||
break; |
||||
} |
||||
} |
||||
return msg; |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Class method variant: serializes the given message to binary data |
||||
* (in protobuf wire format), writing to the given BinaryWriter. |
||||
* @param {!proto.math.DivReply} message |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.DivReply.serializeBinaryToWriter = function(message, writer) { |
||||
message.serializeBinaryToWriter(writer); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format). |
||||
* @return {!Uint8Array} |
||||
*/ |
||||
proto.math.DivReply.prototype.serializeBinary = function() { |
||||
var writer = new jspb.BinaryWriter(); |
||||
this.serializeBinaryToWriter(writer); |
||||
return writer.getResultBuffer(); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format), |
||||
* writing to the given BinaryWriter. |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.DivReply.prototype.serializeBinaryToWriter = function (writer) { |
||||
var f = undefined; |
||||
f = this.getQuotient(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
1, |
||||
f |
||||
); |
||||
} |
||||
f = this.getRemainder(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
2, |
||||
f |
||||
); |
||||
} |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Creates a deep clone of this proto. No data is shared with the original. |
||||
* @return {!proto.math.DivReply} The clone. |
||||
*/ |
||||
proto.math.DivReply.prototype.cloneMessage = function() { |
||||
return /** @type {!proto.math.DivReply} */ (jspb.Message.cloneMessage(this)); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 quotient = 1; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.DivReply.prototype.getQuotient = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.DivReply.prototype.setQuotient = function(value) { |
||||
jspb.Message.setField(this, 1, value); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 remainder = 2; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.DivReply.prototype.getRemainder = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.DivReply.prototype.setRemainder = function(value) { |
||||
jspb.Message.setField(this, 2, value); |
||||
}; |
||||
|
||||
|
||||
|
||||
/** |
||||
* Generated by JsPbCodeGenerator. |
||||
* @param {Array=} opt_data Optional initial data array, typically from a |
||||
* server response, or constructed directly in Javascript. The array is used |
||||
* in place and becomes part of the constructed object. It is not cloned. |
||||
* If no data is provided, the constructed object will be empty, but still |
||||
* valid. |
||||
* @extends {jspb.Message} |
||||
* @constructor |
||||
*/ |
||||
proto.math.FibArgs = function(opt_data) { |
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
||||
}; |
||||
goog.inherits(proto.math.FibArgs, jspb.Message); |
||||
if (goog.DEBUG && !COMPILED) { |
||||
proto.math.FibArgs.displayName = 'proto.math.FibArgs'; |
||||
} |
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) { |
||||
/** |
||||
* Creates an object representation of this proto suitable for use in Soy templates. |
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. |
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
||||
* For the list of reserved names please see: |
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.FibArgs.prototype.toObject = function(opt_includeInstance) { |
||||
return proto.math.FibArgs.toObject(opt_includeInstance, this); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Static version of the {@see toObject} method. |
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB |
||||
* instance for transitional soy proto support: |
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.math.FibArgs} msg The msg instance to transform. |
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.FibArgs.toObject = function(includeInstance, msg) { |
||||
var f, obj = { |
||||
limit: msg.getLimit() |
||||
}; |
||||
|
||||
if (includeInstance) { |
||||
obj.$jspbMessageInstance = msg |
||||
} |
||||
return obj; |
||||
}; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format). |
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. |
||||
* @return {!proto.math.FibArgs} |
||||
*/ |
||||
proto.math.FibArgs.deserializeBinary = function(bytes) { |
||||
var reader = new jspb.BinaryReader(bytes); |
||||
var msg = new proto.math.FibArgs; |
||||
return proto.math.FibArgs.deserializeBinaryFromReader(msg, reader); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format) from the |
||||
* given reader into the given message object. |
||||
* @param {!proto.math.FibArgs} msg The message object to deserialize into. |
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. |
||||
* @return {!proto.math.FibArgs} |
||||
*/ |
||||
proto.math.FibArgs.deserializeBinaryFromReader = function(msg, reader) { |
||||
while (reader.nextField()) { |
||||
if (reader.isEndGroup()) { |
||||
break; |
||||
} |
||||
var field = reader.getFieldNumber(); |
||||
switch (field) { |
||||
case 1: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setLimit(value); |
||||
break; |
||||
default: |
||||
reader.skipField(); |
||||
break; |
||||
} |
||||
} |
||||
return msg; |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Class method variant: serializes the given message to binary data |
||||
* (in protobuf wire format), writing to the given BinaryWriter. |
||||
* @param {!proto.math.FibArgs} message |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.FibArgs.serializeBinaryToWriter = function(message, writer) { |
||||
message.serializeBinaryToWriter(writer); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format). |
||||
* @return {!Uint8Array} |
||||
*/ |
||||
proto.math.FibArgs.prototype.serializeBinary = function() { |
||||
var writer = new jspb.BinaryWriter(); |
||||
this.serializeBinaryToWriter(writer); |
||||
return writer.getResultBuffer(); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format), |
||||
* writing to the given BinaryWriter. |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.FibArgs.prototype.serializeBinaryToWriter = function (writer) { |
||||
var f = undefined; |
||||
f = this.getLimit(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
1, |
||||
f |
||||
); |
||||
} |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Creates a deep clone of this proto. No data is shared with the original. |
||||
* @return {!proto.math.FibArgs} The clone. |
||||
*/ |
||||
proto.math.FibArgs.prototype.cloneMessage = function() { |
||||
return /** @type {!proto.math.FibArgs} */ (jspb.Message.cloneMessage(this)); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 limit = 1; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.FibArgs.prototype.getLimit = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.FibArgs.prototype.setLimit = function(value) { |
||||
jspb.Message.setField(this, 1, value); |
||||
}; |
||||
|
||||
|
||||
|
||||
/** |
||||
* Generated by JsPbCodeGenerator. |
||||
* @param {Array=} opt_data Optional initial data array, typically from a |
||||
* server response, or constructed directly in Javascript. The array is used |
||||
* in place and becomes part of the constructed object. It is not cloned. |
||||
* If no data is provided, the constructed object will be empty, but still |
||||
* valid. |
||||
* @extends {jspb.Message} |
||||
* @constructor |
||||
*/ |
||||
proto.math.Num = function(opt_data) { |
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
||||
}; |
||||
goog.inherits(proto.math.Num, jspb.Message); |
||||
if (goog.DEBUG && !COMPILED) { |
||||
proto.math.Num.displayName = 'proto.math.Num'; |
||||
} |
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) { |
||||
/** |
||||
* Creates an object representation of this proto suitable for use in Soy templates. |
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. |
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
||||
* For the list of reserved names please see: |
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.Num.prototype.toObject = function(opt_includeInstance) { |
||||
return proto.math.Num.toObject(opt_includeInstance, this); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Static version of the {@see toObject} method. |
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB |
||||
* instance for transitional soy proto support: |
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.math.Num} msg The msg instance to transform. |
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.Num.toObject = function(includeInstance, msg) { |
||||
var f, obj = { |
||||
num: msg.getNum() |
||||
}; |
||||
|
||||
if (includeInstance) { |
||||
obj.$jspbMessageInstance = msg |
||||
} |
||||
return obj; |
||||
}; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format). |
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. |
||||
* @return {!proto.math.Num} |
||||
*/ |
||||
proto.math.Num.deserializeBinary = function(bytes) { |
||||
var reader = new jspb.BinaryReader(bytes); |
||||
var msg = new proto.math.Num; |
||||
return proto.math.Num.deserializeBinaryFromReader(msg, reader); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format) from the |
||||
* given reader into the given message object. |
||||
* @param {!proto.math.Num} msg The message object to deserialize into. |
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. |
||||
* @return {!proto.math.Num} |
||||
*/ |
||||
proto.math.Num.deserializeBinaryFromReader = function(msg, reader) { |
||||
while (reader.nextField()) { |
||||
if (reader.isEndGroup()) { |
||||
break; |
||||
} |
||||
var field = reader.getFieldNumber(); |
||||
switch (field) { |
||||
case 1: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setNum(value); |
||||
break; |
||||
default: |
||||
reader.skipField(); |
||||
break; |
||||
} |
||||
} |
||||
return msg; |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Class method variant: serializes the given message to binary data |
||||
* (in protobuf wire format), writing to the given BinaryWriter. |
||||
* @param {!proto.math.Num} message |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.Num.serializeBinaryToWriter = function(message, writer) { |
||||
message.serializeBinaryToWriter(writer); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format). |
||||
* @return {!Uint8Array} |
||||
*/ |
||||
proto.math.Num.prototype.serializeBinary = function() { |
||||
var writer = new jspb.BinaryWriter(); |
||||
this.serializeBinaryToWriter(writer); |
||||
return writer.getResultBuffer(); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format), |
||||
* writing to the given BinaryWriter. |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.Num.prototype.serializeBinaryToWriter = function (writer) { |
||||
var f = undefined; |
||||
f = this.getNum(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
1, |
||||
f |
||||
); |
||||
} |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Creates a deep clone of this proto. No data is shared with the original. |
||||
* @return {!proto.math.Num} The clone. |
||||
*/ |
||||
proto.math.Num.prototype.cloneMessage = function() { |
||||
return /** @type {!proto.math.Num} */ (jspb.Message.cloneMessage(this)); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 num = 1; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.Num.prototype.getNum = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.Num.prototype.setNum = function(value) { |
||||
jspb.Message.setField(this, 1, value); |
||||
}; |
||||
|
||||
|
||||
|
||||
/** |
||||
* Generated by JsPbCodeGenerator. |
||||
* @param {Array=} opt_data Optional initial data array, typically from a |
||||
* server response, or constructed directly in Javascript. The array is used |
||||
* in place and becomes part of the constructed object. It is not cloned. |
||||
* If no data is provided, the constructed object will be empty, but still |
||||
* valid. |
||||
* @extends {jspb.Message} |
||||
* @constructor |
||||
*/ |
||||
proto.math.FibReply = function(opt_data) { |
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
||||
}; |
||||
goog.inherits(proto.math.FibReply, jspb.Message); |
||||
if (goog.DEBUG && !COMPILED) { |
||||
proto.math.FibReply.displayName = 'proto.math.FibReply'; |
||||
} |
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) { |
||||
/** |
||||
* Creates an object representation of this proto suitable for use in Soy templates. |
||||
* Field names that are reserved in JavaScript and will be renamed to pb_name. |
||||
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
||||
* For the list of reserved names please see: |
||||
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
||||
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
||||
* for transitional soy proto support: http://goto/soy-param-migration
|
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.FibReply.prototype.toObject = function(opt_includeInstance) { |
||||
return proto.math.FibReply.toObject(opt_includeInstance, this); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Static version of the {@see toObject} method. |
||||
* @param {boolean|undefined} includeInstance Whether to include the JSPB |
||||
* instance for transitional soy proto support: |
||||
* http://goto/soy-param-migration
|
||||
* @param {!proto.math.FibReply} msg The msg instance to transform. |
||||
* @return {!Object} |
||||
*/ |
||||
proto.math.FibReply.toObject = function(includeInstance, msg) { |
||||
var f, obj = { |
||||
count: msg.getCount() |
||||
}; |
||||
|
||||
if (includeInstance) { |
||||
obj.$jspbMessageInstance = msg |
||||
} |
||||
return obj; |
||||
}; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format). |
||||
* @param {jspb.ByteSource} bytes The bytes to deserialize. |
||||
* @return {!proto.math.FibReply} |
||||
*/ |
||||
proto.math.FibReply.deserializeBinary = function(bytes) { |
||||
var reader = new jspb.BinaryReader(bytes); |
||||
var msg = new proto.math.FibReply; |
||||
return proto.math.FibReply.deserializeBinaryFromReader(msg, reader); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Deserializes binary data (in protobuf wire format) from the |
||||
* given reader into the given message object. |
||||
* @param {!proto.math.FibReply} msg The message object to deserialize into. |
||||
* @param {!jspb.BinaryReader} reader The BinaryReader to use. |
||||
* @return {!proto.math.FibReply} |
||||
*/ |
||||
proto.math.FibReply.deserializeBinaryFromReader = function(msg, reader) { |
||||
while (reader.nextField()) { |
||||
if (reader.isEndGroup()) { |
||||
break; |
||||
} |
||||
var field = reader.getFieldNumber(); |
||||
switch (field) { |
||||
case 1: |
||||
var value = /** @type {number} */ (reader.readInt64()); |
||||
msg.setCount(value); |
||||
break; |
||||
default: |
||||
reader.skipField(); |
||||
break; |
||||
} |
||||
} |
||||
return msg; |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Class method variant: serializes the given message to binary data |
||||
* (in protobuf wire format), writing to the given BinaryWriter. |
||||
* @param {!proto.math.FibReply} message |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.FibReply.serializeBinaryToWriter = function(message, writer) { |
||||
message.serializeBinaryToWriter(writer); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format). |
||||
* @return {!Uint8Array} |
||||
*/ |
||||
proto.math.FibReply.prototype.serializeBinary = function() { |
||||
var writer = new jspb.BinaryWriter(); |
||||
this.serializeBinaryToWriter(writer); |
||||
return writer.getResultBuffer(); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Serializes the message to binary data (in protobuf wire format), |
||||
* writing to the given BinaryWriter. |
||||
* @param {!jspb.BinaryWriter} writer |
||||
*/ |
||||
proto.math.FibReply.prototype.serializeBinaryToWriter = function (writer) { |
||||
var f = undefined; |
||||
f = this.getCount(); |
||||
if (f !== 0) { |
||||
writer.writeInt64( |
||||
1, |
||||
f |
||||
); |
||||
} |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* Creates a deep clone of this proto. No data is shared with the original. |
||||
* @return {!proto.math.FibReply} The clone. |
||||
*/ |
||||
proto.math.FibReply.prototype.cloneMessage = function() { |
||||
return /** @type {!proto.math.FibReply} */ (jspb.Message.cloneMessage(this)); |
||||
}; |
||||
|
||||
|
||||
/** |
||||
* optional int64 count = 1; |
||||
* @return {number} |
||||
*/ |
||||
proto.math.FibReply.prototype.getCount = function() { |
||||
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0)); |
||||
}; |
||||
|
||||
|
||||
/** @param {number} value */ |
||||
proto.math.FibReply.prototype.setCount = function(value) { |
||||
jspb.Message.setField(this, 1, value); |
||||
}; |
||||
|
||||
|
||||
goog.object.extend(exports, proto.math); |
Loading…
Reference in new issue