jarviscrawlercore
Version:
jarvis crawler core
592 lines (513 loc) • 16.6 kB
JavaScript
// source: geoip.proto
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.jarviscrawlercore.ReplyGeoIP', null, global);
goog.exportSymbol('proto.jarviscrawlercore.RequestGeoIP', 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.jarviscrawlercore.RequestGeoIP = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.jarviscrawlercore.RequestGeoIP, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.RequestGeoIP.displayName = 'proto.jarviscrawlercore.RequestGeoIP';
}
/**
* 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.jarviscrawlercore.ReplyGeoIP = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.jarviscrawlercore.ReplyGeoIP, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.ReplyGeoIP.displayName = 'proto.jarviscrawlercore.ReplyGeoIP';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.jarviscrawlercore.RequestGeoIP.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.RequestGeoIP.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.jarviscrawlercore.RequestGeoIP} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.RequestGeoIP.toObject = function(includeInstance, msg) {
var f, obj = {
ip: jspb.Message.getFieldWithDefault(msg, 1, ""),
platform: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.jarviscrawlercore.RequestGeoIP}
*/
proto.jarviscrawlercore.RequestGeoIP.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.RequestGeoIP;
return proto.jarviscrawlercore.RequestGeoIP.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.RequestGeoIP} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.RequestGeoIP}
*/
proto.jarviscrawlercore.RequestGeoIP.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setIp(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setPlatform(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.RequestGeoIP.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.RequestGeoIP.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.RequestGeoIP} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.RequestGeoIP.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getIp();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPlatform();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string ip = 1;
* @return {string}
*/
proto.jarviscrawlercore.RequestGeoIP.prototype.getIp = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.RequestGeoIP} returns this
*/
proto.jarviscrawlercore.RequestGeoIP.prototype.setIp = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string platform = 2;
* @return {string}
*/
proto.jarviscrawlercore.RequestGeoIP.prototype.getPlatform = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.RequestGeoIP} returns this
*/
proto.jarviscrawlercore.RequestGeoIP.prototype.setPlatform = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.ReplyGeoIP.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.jarviscrawlercore.ReplyGeoIP} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.ReplyGeoIP.toObject = function(includeInstance, msg) {
var f, obj = {
latitude: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0),
longitude: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0),
organization: jspb.Message.getFieldWithDefault(msg, 3, ""),
asn: jspb.Message.getFieldWithDefault(msg, 4, ""),
continent: jspb.Message.getFieldWithDefault(msg, 5, ""),
country: jspb.Message.getFieldWithDefault(msg, 6, ""),
region: jspb.Message.getFieldWithDefault(msg, 7, ""),
city: jspb.Message.getFieldWithDefault(msg, 8, ""),
hostname: jspb.Message.getFieldWithDefault(msg, 9, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.jarviscrawlercore.ReplyGeoIP}
*/
proto.jarviscrawlercore.ReplyGeoIP.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.ReplyGeoIP;
return proto.jarviscrawlercore.ReplyGeoIP.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.ReplyGeoIP} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.ReplyGeoIP}
*/
proto.jarviscrawlercore.ReplyGeoIP.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readFloat());
msg.setLatitude(value);
break;
case 2:
var value = /** @type {number} */ (reader.readFloat());
msg.setLongitude(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setOrganization(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setAsn(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setContinent(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setCountry(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setRegion(value);
break;
case 8:
var value = /** @type {string} */ (reader.readString());
msg.setCity(value);
break;
case 9:
var value = /** @type {string} */ (reader.readString());
msg.setHostname(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.ReplyGeoIP.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.ReplyGeoIP} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.ReplyGeoIP.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLatitude();
if (f !== 0.0) {
writer.writeFloat(
1,
f
);
}
f = message.getLongitude();
if (f !== 0.0) {
writer.writeFloat(
2,
f
);
}
f = message.getOrganization();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getAsn();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getContinent();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getCountry();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
f = message.getRegion();
if (f.length > 0) {
writer.writeString(
7,
f
);
}
f = message.getCity();
if (f.length > 0) {
writer.writeString(
8,
f
);
}
f = message.getHostname();
if (f.length > 0) {
writer.writeString(
9,
f
);
}
};
/**
* optional float latitude = 1;
* @return {number}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getLatitude = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0));
};
/**
* @param {number} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setLatitude = function(value) {
return jspb.Message.setProto3FloatField(this, 1, value);
};
/**
* optional float longitude = 2;
* @return {number}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getLongitude = function() {
return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0));
};
/**
* @param {number} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setLongitude = function(value) {
return jspb.Message.setProto3FloatField(this, 2, value);
};
/**
* optional string organization = 3;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getOrganization = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setOrganization = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string asn = 4;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getAsn = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setAsn = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string continent = 5;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getContinent = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setContinent = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional string country = 6;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getCountry = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setCountry = function(value) {
return jspb.Message.setProto3StringField(this, 6, value);
};
/**
* optional string region = 7;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getRegion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setRegion = function(value) {
return jspb.Message.setProto3StringField(this, 7, value);
};
/**
* optional string city = 8;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getCity = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setCity = function(value) {
return jspb.Message.setProto3StringField(this, 8, value);
};
/**
* optional string hostname = 9;
* @return {string}
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.getHostname = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.ReplyGeoIP} returns this
*/
proto.jarviscrawlercore.ReplyGeoIP.prototype.setHostname = function(value) {
return jspb.Message.setProto3StringField(this, 9, value);
};
goog.object.extend(exports, proto.jarviscrawlercore);