UNPKG

xray-grpc

Version:
389 lines (337 loc) 11.8 kB
// source: common/net/port.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @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() { if (this) { return this; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } if (typeof self !== 'undefined') { return self; } return Function('return this')(); }.call(null)); goog.exportSymbol('proto.xray.common.net.PortList', null, global); goog.exportSymbol('proto.xray.common.net.PortRange', 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.xray.common.net.PortRange = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.xray.common.net.PortRange, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.common.net.PortRange.displayName = 'proto.xray.common.net.PortRange'; } /** * 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.xray.common.net.PortList = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.common.net.PortList.repeatedFields_, null); }; goog.inherits(proto.xray.common.net.PortList, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.common.net.PortList.displayName = 'proto.xray.common.net.PortList'; } 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.xray.common.net.PortRange.prototype.toObject = function(opt_includeInstance) { return proto.xray.common.net.PortRange.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.xray.common.net.PortRange} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.common.net.PortRange.toObject = function(includeInstance, msg) { var f, obj = { from: jspb.Message.getFieldWithDefault(msg, 1, 0), to: jspb.Message.getFieldWithDefault(msg, 2, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.xray.common.net.PortRange} */ proto.xray.common.net.PortRange.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.common.net.PortRange; return proto.xray.common.net.PortRange.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.common.net.PortRange} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.common.net.PortRange} */ proto.xray.common.net.PortRange.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readUint32()); msg.setFrom(value); break; case 2: var value = /** @type {number} */ (reader.readUint32()); msg.setTo(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.common.net.PortRange.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.common.net.PortRange.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.xray.common.net.PortRange} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.common.net.PortRange.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getFrom(); if (f !== 0) { writer.writeUint32( 1, f ); } f = message.getTo(); if (f !== 0) { writer.writeUint32( 2, f ); } }; /** * optional uint32 From = 1; * @return {number} */ proto.xray.common.net.PortRange.prototype.getFrom = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.xray.common.net.PortRange} returns this */ proto.xray.common.net.PortRange.prototype.setFrom = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional uint32 To = 2; * @return {number} */ proto.xray.common.net.PortRange.prototype.getTo = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.xray.common.net.PortRange} returns this */ proto.xray.common.net.PortRange.prototype.setTo = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.xray.common.net.PortList.repeatedFields_ = [1]; 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.xray.common.net.PortList.prototype.toObject = function(opt_includeInstance) { return proto.xray.common.net.PortList.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.xray.common.net.PortList} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.common.net.PortList.toObject = function(includeInstance, msg) { var f, obj = { rangeList: jspb.Message.toObjectList(msg.getRangeList(), proto.xray.common.net.PortRange.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.xray.common.net.PortList} */ proto.xray.common.net.PortList.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.common.net.PortList; return proto.xray.common.net.PortList.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.common.net.PortList} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.common.net.PortList} */ proto.xray.common.net.PortList.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.xray.common.net.PortRange; reader.readMessage(value,proto.xray.common.net.PortRange.deserializeBinaryFromReader); msg.addRange(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.common.net.PortList.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.common.net.PortList.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.xray.common.net.PortList} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.common.net.PortList.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getRangeList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.xray.common.net.PortRange.serializeBinaryToWriter ); } }; /** * repeated PortRange range = 1; * @return {!Array<!proto.xray.common.net.PortRange>} */ proto.xray.common.net.PortList.prototype.getRangeList = function() { return /** @type{!Array<!proto.xray.common.net.PortRange>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.xray.common.net.PortRange, 1)); }; /** * @param {!Array<!proto.xray.common.net.PortRange>} value * @return {!proto.xray.common.net.PortList} returns this */ proto.xray.common.net.PortList.prototype.setRangeList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** * @param {!proto.xray.common.net.PortRange=} opt_value * @param {number=} opt_index * @return {!proto.xray.common.net.PortRange} */ proto.xray.common.net.PortList.prototype.addRange = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.xray.common.net.PortRange, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.xray.common.net.PortList} returns this */ proto.xray.common.net.PortList.prototype.clearRangeList = function() { return this.setRangeList([]); }; goog.object.extend(exports, proto.xray.common.net);