UNPKG

xray-grpc

Version:
1,602 lines (1,401 loc) 107 kB
// source: router_config.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)); var common_serial_typed_message_pb = require('./common/serial/typed_message_pb.js'); goog.object.extend(proto, common_serial_typed_message_pb); var common_net_port_pb = require('./common/net/port_pb.js'); goog.object.extend(proto, common_net_port_pb); var common_net_network_pb = require('./common/net/network_pb.js'); goog.object.extend(proto, common_net_network_pb); goog.exportSymbol('proto.xray.app.router.BalancingRule', null, global); goog.exportSymbol('proto.xray.app.router.CIDR', null, global); goog.exportSymbol('proto.xray.app.router.Config', null, global); goog.exportSymbol('proto.xray.app.router.Config.DomainStrategy', null, global); goog.exportSymbol('proto.xray.app.router.Domain', null, global); goog.exportSymbol('proto.xray.app.router.Domain.Attribute', null, global); goog.exportSymbol('proto.xray.app.router.Domain.Attribute.TypedValueCase', null, global); goog.exportSymbol('proto.xray.app.router.Domain.Type', null, global); goog.exportSymbol('proto.xray.app.router.GeoIP', null, global); goog.exportSymbol('proto.xray.app.router.GeoIPList', null, global); goog.exportSymbol('proto.xray.app.router.GeoSite', null, global); goog.exportSymbol('proto.xray.app.router.GeoSiteList', null, global); goog.exportSymbol('proto.xray.app.router.RoutingRule', null, global); goog.exportSymbol('proto.xray.app.router.RoutingRule.TargetTagCase', null, global); goog.exportSymbol('proto.xray.app.router.StrategyLeastLoadConfig', null, global); goog.exportSymbol('proto.xray.app.router.StrategyWeight', 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.app.router.Domain = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.Domain.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.Domain, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.Domain.displayName = 'proto.xray.app.router.Domain'; } /** * 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.app.router.Domain.Attribute = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.xray.app.router.Domain.Attribute.oneofGroups_); }; goog.inherits(proto.xray.app.router.Domain.Attribute, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.Domain.Attribute.displayName = 'proto.xray.app.router.Domain.Attribute'; } /** * 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.app.router.CIDR = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.xray.app.router.CIDR, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.CIDR.displayName = 'proto.xray.app.router.CIDR'; } /** * 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.app.router.GeoIP = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.GeoIP.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.GeoIP, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.GeoIP.displayName = 'proto.xray.app.router.GeoIP'; } /** * 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.app.router.GeoIPList = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.GeoIPList.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.GeoIPList, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.GeoIPList.displayName = 'proto.xray.app.router.GeoIPList'; } /** * 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.app.router.GeoSite = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.GeoSite.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.GeoSite, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.GeoSite.displayName = 'proto.xray.app.router.GeoSite'; } /** * 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.app.router.GeoSiteList = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.GeoSiteList.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.GeoSiteList, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.GeoSiteList.displayName = 'proto.xray.app.router.GeoSiteList'; } /** * 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.app.router.RoutingRule = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.RoutingRule.repeatedFields_, proto.xray.app.router.RoutingRule.oneofGroups_); }; goog.inherits(proto.xray.app.router.RoutingRule, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.RoutingRule.displayName = 'proto.xray.app.router.RoutingRule'; } /** * 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.app.router.BalancingRule = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.BalancingRule.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.BalancingRule, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.BalancingRule.displayName = 'proto.xray.app.router.BalancingRule'; } /** * 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.app.router.StrategyWeight = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.xray.app.router.StrategyWeight, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.StrategyWeight.displayName = 'proto.xray.app.router.StrategyWeight'; } /** * 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.app.router.StrategyLeastLoadConfig = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.StrategyLeastLoadConfig.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.StrategyLeastLoadConfig, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.StrategyLeastLoadConfig.displayName = 'proto.xray.app.router.StrategyLeastLoadConfig'; } /** * 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.app.router.Config = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.app.router.Config.repeatedFields_, null); }; goog.inherits(proto.xray.app.router.Config, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.xray.app.router.Config.displayName = 'proto.xray.app.router.Config'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.xray.app.router.Domain.repeatedFields_ = [3]; 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.app.router.Domain.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.Domain.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.app.router.Domain} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.Domain.toObject = function(includeInstance, msg) { var f, obj = { type: jspb.Message.getFieldWithDefault(msg, 1, 0), value: jspb.Message.getFieldWithDefault(msg, 2, ""), attributeList: jspb.Message.toObjectList(msg.getAttributeList(), proto.xray.app.router.Domain.Attribute.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.app.router.Domain} */ proto.xray.app.router.Domain.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.Domain; return proto.xray.app.router.Domain.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.Domain} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.app.router.Domain} */ proto.xray.app.router.Domain.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.xray.app.router.Domain.Type} */ (reader.readEnum()); msg.setType(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setValue(value); break; case 3: var value = new proto.xray.app.router.Domain.Attribute; reader.readMessage(value,proto.xray.app.router.Domain.Attribute.deserializeBinaryFromReader); msg.addAttribute(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.app.router.Domain.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.app.router.Domain.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.app.router.Domain} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.Domain.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getType(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getValue(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getAttributeList(); if (f.length > 0) { writer.writeRepeatedMessage( 3, f, proto.xray.app.router.Domain.Attribute.serializeBinaryToWriter ); } }; /** * @enum {number} */ proto.xray.app.router.Domain.Type = { PLAIN: 0, REGEX: 1, DOMAIN: 2, FULL: 3 }; /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all * other fields in the group are cleared. During deserialization, if multiple * fields are encountered for a group, only the last value seen will be kept. * @private {!Array<!Array<number>>} * @const */ proto.xray.app.router.Domain.Attribute.oneofGroups_ = [[2,3]]; /** * @enum {number} */ proto.xray.app.router.Domain.Attribute.TypedValueCase = { TYPED_VALUE_NOT_SET: 0, BOOL_VALUE: 2, INT_VALUE: 3 }; /** * @return {proto.xray.app.router.Domain.Attribute.TypedValueCase} */ proto.xray.app.router.Domain.Attribute.prototype.getTypedValueCase = function() { return /** @type {proto.xray.app.router.Domain.Attribute.TypedValueCase} */(jspb.Message.computeOneofCase(this, proto.xray.app.router.Domain.Attribute.oneofGroups_[0])); }; 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.app.router.Domain.Attribute.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.Domain.Attribute.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.app.router.Domain.Attribute} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.Domain.Attribute.toObject = function(includeInstance, msg) { var f, obj = { key: jspb.Message.getFieldWithDefault(msg, 1, ""), boolValue: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), intValue: jspb.Message.getFieldWithDefault(msg, 3, 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.app.router.Domain.Attribute} */ proto.xray.app.router.Domain.Attribute.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.Domain.Attribute; return proto.xray.app.router.Domain.Attribute.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.Domain.Attribute} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.app.router.Domain.Attribute} */ proto.xray.app.router.Domain.Attribute.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.setKey(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); msg.setBoolValue(value); break; case 3: var value = /** @type {number} */ (reader.readInt64()); msg.setIntValue(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.app.router.Domain.Attribute.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.app.router.Domain.Attribute.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.app.router.Domain.Attribute} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.Domain.Attribute.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getKey(); if (f.length > 0) { writer.writeString( 1, f ); } f = /** @type {boolean} */ (jspb.Message.getField(message, 2)); if (f != null) { writer.writeBool( 2, f ); } f = /** @type {number} */ (jspb.Message.getField(message, 3)); if (f != null) { writer.writeInt64( 3, f ); } }; /** * optional string key = 1; * @return {string} */ proto.xray.app.router.Domain.Attribute.prototype.getKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.xray.app.router.Domain.Attribute} returns this */ proto.xray.app.router.Domain.Attribute.prototype.setKey = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional bool bool_value = 2; * @return {boolean} */ proto.xray.app.router.Domain.Attribute.prototype.getBoolValue = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value * @return {!proto.xray.app.router.Domain.Attribute} returns this */ proto.xray.app.router.Domain.Attribute.prototype.setBoolValue = function(value) { return jspb.Message.setOneofField(this, 2, proto.xray.app.router.Domain.Attribute.oneofGroups_[0], value); }; /** * Clears the field making it undefined. * @return {!proto.xray.app.router.Domain.Attribute} returns this */ proto.xray.app.router.Domain.Attribute.prototype.clearBoolValue = function() { return jspb.Message.setOneofField(this, 2, proto.xray.app.router.Domain.Attribute.oneofGroups_[0], undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.xray.app.router.Domain.Attribute.prototype.hasBoolValue = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional int64 int_value = 3; * @return {number} */ proto.xray.app.router.Domain.Attribute.prototype.getIntValue = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.xray.app.router.Domain.Attribute} returns this */ proto.xray.app.router.Domain.Attribute.prototype.setIntValue = function(value) { return jspb.Message.setOneofField(this, 3, proto.xray.app.router.Domain.Attribute.oneofGroups_[0], value); }; /** * Clears the field making it undefined. * @return {!proto.xray.app.router.Domain.Attribute} returns this */ proto.xray.app.router.Domain.Attribute.prototype.clearIntValue = function() { return jspb.Message.setOneofField(this, 3, proto.xray.app.router.Domain.Attribute.oneofGroups_[0], undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.xray.app.router.Domain.Attribute.prototype.hasIntValue = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional Type type = 1; * @return {!proto.xray.app.router.Domain.Type} */ proto.xray.app.router.Domain.prototype.getType = function() { return /** @type {!proto.xray.app.router.Domain.Type} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.xray.app.router.Domain.Type} value * @return {!proto.xray.app.router.Domain} returns this */ proto.xray.app.router.Domain.prototype.setType = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional string value = 2; * @return {string} */ proto.xray.app.router.Domain.prototype.getValue = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * @param {string} value * @return {!proto.xray.app.router.Domain} returns this */ proto.xray.app.router.Domain.prototype.setValue = function(value) { return jspb.Message.setProto3StringField(this, 2, value); }; /** * repeated Attribute attribute = 3; * @return {!Array<!proto.xray.app.router.Domain.Attribute>} */ proto.xray.app.router.Domain.prototype.getAttributeList = function() { return /** @type{!Array<!proto.xray.app.router.Domain.Attribute>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.xray.app.router.Domain.Attribute, 3)); }; /** * @param {!Array<!proto.xray.app.router.Domain.Attribute>} value * @return {!proto.xray.app.router.Domain} returns this */ proto.xray.app.router.Domain.prototype.setAttributeList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 3, value); }; /** * @param {!proto.xray.app.router.Domain.Attribute=} opt_value * @param {number=} opt_index * @return {!proto.xray.app.router.Domain.Attribute} */ proto.xray.app.router.Domain.prototype.addAttribute = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.xray.app.router.Domain.Attribute, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.xray.app.router.Domain} returns this */ proto.xray.app.router.Domain.prototype.clearAttributeList = function() { return this.setAttributeList([]); }; 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.app.router.CIDR.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.CIDR.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.app.router.CIDR} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.CIDR.toObject = function(includeInstance, msg) { var f, obj = { ip: msg.getIp_asB64(), prefix: 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.app.router.CIDR} */ proto.xray.app.router.CIDR.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.CIDR; return proto.xray.app.router.CIDR.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.CIDR} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.app.router.CIDR} */ proto.xray.app.router.CIDR.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setIp(value); break; case 2: var value = /** @type {number} */ (reader.readUint32()); msg.setPrefix(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.app.router.CIDR.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.app.router.CIDR.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.app.router.CIDR} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.CIDR.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getIp_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getPrefix(); if (f !== 0) { writer.writeUint32( 2, f ); } }; /** * optional bytes ip = 1; * @return {!(string|Uint8Array)} */ proto.xray.app.router.CIDR.prototype.getIp = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes ip = 1; * This is a type-conversion wrapper around `getIp()` * @return {string} */ proto.xray.app.router.CIDR.prototype.getIp_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getIp())); }; /** * optional bytes ip = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getIp()` * @return {!Uint8Array} */ proto.xray.app.router.CIDR.prototype.getIp_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getIp())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.xray.app.router.CIDR} returns this */ proto.xray.app.router.CIDR.prototype.setIp = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint32 prefix = 2; * @return {number} */ proto.xray.app.router.CIDR.prototype.getPrefix = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.xray.app.router.CIDR} returns this */ proto.xray.app.router.CIDR.prototype.setPrefix = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.xray.app.router.GeoIP.repeatedFields_ = [2]; 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.app.router.GeoIP.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.GeoIP.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.app.router.GeoIP} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoIP.toObject = function(includeInstance, msg) { var f, obj = { countryCode: jspb.Message.getFieldWithDefault(msg, 1, ""), cidrList: jspb.Message.toObjectList(msg.getCidrList(), proto.xray.app.router.CIDR.toObject, includeInstance), reverseMatch: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) }; 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.app.router.GeoIP} */ proto.xray.app.router.GeoIP.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.GeoIP; return proto.xray.app.router.GeoIP.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.GeoIP} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.app.router.GeoIP} */ proto.xray.app.router.GeoIP.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.setCountryCode(value); break; case 2: var value = new proto.xray.app.router.CIDR; reader.readMessage(value,proto.xray.app.router.CIDR.deserializeBinaryFromReader); msg.addCidr(value); break; case 3: var value = /** @type {boolean} */ (reader.readBool()); msg.setReverseMatch(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.app.router.GeoIP.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.app.router.GeoIP.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.app.router.GeoIP} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoIP.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCountryCode(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getCidrList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, proto.xray.app.router.CIDR.serializeBinaryToWriter ); } f = message.getReverseMatch(); if (f) { writer.writeBool( 3, f ); } }; /** * optional string country_code = 1; * @return {string} */ proto.xray.app.router.GeoIP.prototype.getCountryCode = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.xray.app.router.GeoIP} returns this */ proto.xray.app.router.GeoIP.prototype.setCountryCode = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * repeated CIDR cidr = 2; * @return {!Array<!proto.xray.app.router.CIDR>} */ proto.xray.app.router.GeoIP.prototype.getCidrList = function() { return /** @type{!Array<!proto.xray.app.router.CIDR>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.xray.app.router.CIDR, 2)); }; /** * @param {!Array<!proto.xray.app.router.CIDR>} value * @return {!proto.xray.app.router.GeoIP} returns this */ proto.xray.app.router.GeoIP.prototype.setCidrList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.xray.app.router.CIDR=} opt_value * @param {number=} opt_index * @return {!proto.xray.app.router.CIDR} */ proto.xray.app.router.GeoIP.prototype.addCidr = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.xray.app.router.CIDR, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.xray.app.router.GeoIP} returns this */ proto.xray.app.router.GeoIP.prototype.clearCidrList = function() { return this.setCidrList([]); }; /** * optional bool reverse_match = 3; * @return {boolean} */ proto.xray.app.router.GeoIP.prototype.getReverseMatch = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; /** * @param {boolean} value * @return {!proto.xray.app.router.GeoIP} returns this */ proto.xray.app.router.GeoIP.prototype.setReverseMatch = function(value) { return jspb.Message.setProto3BooleanField(this, 3, value); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.xray.app.router.GeoIPList.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.app.router.GeoIPList.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.GeoIPList.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.app.router.GeoIPList} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoIPList.toObject = function(includeInstance, msg) { var f, obj = { entryList: jspb.Message.toObjectList(msg.getEntryList(), proto.xray.app.router.GeoIP.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.app.router.GeoIPList} */ proto.xray.app.router.GeoIPList.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.GeoIPList; return proto.xray.app.router.GeoIPList.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.GeoIPList} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.app.router.GeoIPList} */ proto.xray.app.router.GeoIPList.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.xray.app.router.GeoIP; reader.readMessage(value,proto.xray.app.router.GeoIP.deserializeBinaryFromReader); msg.addEntry(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.app.router.GeoIPList.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.app.router.GeoIPList.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.app.router.GeoIPList} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoIPList.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getEntryList(); if (f.length > 0) { writer.writeRepeatedMessage( 1, f, proto.xray.app.router.GeoIP.serializeBinaryToWriter ); } }; /** * repeated GeoIP entry = 1; * @return {!Array<!proto.xray.app.router.GeoIP>} */ proto.xray.app.router.GeoIPList.prototype.getEntryList = function() { return /** @type{!Array<!proto.xray.app.router.GeoIP>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.xray.app.router.GeoIP, 1)); }; /** * @param {!Array<!proto.xray.app.router.GeoIP>} value * @return {!proto.xray.app.router.GeoIPList} returns this */ proto.xray.app.router.GeoIPList.prototype.setEntryList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 1, value); }; /** * @param {!proto.xray.app.router.GeoIP=} opt_value * @param {number=} opt_index * @return {!proto.xray.app.router.GeoIP} */ proto.xray.app.router.GeoIPList.prototype.addEntry = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.xray.app.router.GeoIP, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.xray.app.router.GeoIPList} returns this */ proto.xray.app.router.GeoIPList.prototype.clearEntryList = function() { return this.setEntryList([]); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.xray.app.router.GeoSite.repeatedFields_ = [2]; 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.app.router.GeoSite.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.GeoSite.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.app.router.GeoSite} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoSite.toObject = function(includeInstance, msg) { var f, obj = { countryCode: jspb.Message.getFieldWithDefault(msg, 1, ""), domainList: jspb.Message.toObjectList(msg.getDomainList(), proto.xray.app.router.Domain.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.app.router.GeoSite} */ proto.xray.app.router.GeoSite.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.GeoSite; return proto.xray.app.router.GeoSite.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.GeoSite} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.xray.app.router.GeoSite} */ proto.xray.app.router.GeoSite.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.setCountryCode(value); break; case 2: var value = new proto.xray.app.router.Domain; reader.readMessage(value,proto.xray.app.router.Domain.deserializeBinaryFromReader); msg.addDomain(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.xray.app.router.GeoSite.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.xray.app.router.GeoSite.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.app.router.GeoSite} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoSite.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCountryCode(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getDomainList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, proto.xray.app.router.Domain.serializeBinaryToWriter ); } }; /** * optional string country_code = 1; * @return {string} */ proto.xray.app.router.GeoSite.prototype.getCountryCode = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.xray.app.router.GeoSite} returns this */ proto.xray.app.router.GeoSite.prototype.setCountryCode = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * repeated Domain domain = 2; * @return {!Array<!proto.xray.app.router.Domain>} */ proto.xray.app.router.GeoSite.prototype.getDomainList = function() { return /** @type{!Array<!proto.xray.app.router.Domain>} */ ( jspb.Message.getRepeatedWrapperField(this, proto.xray.app.router.Domain, 2)); }; /** * @param {!Array<!proto.xray.app.router.Domain>} value * @return {!proto.xray.app.router.GeoSite} returns this */ proto.xray.app.router.GeoSite.prototype.setDomainList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.xray.app.router.Domain=} opt_value * @param {number=} opt_index * @return {!proto.xray.app.router.Domain} */ proto.xray.app.router.GeoSite.prototype.addDomain = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.xray.app.router.Domain, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.xray.app.router.GeoSite} returns this */ proto.xray.app.router.GeoSite.prototype.clearDomainList = function() { return this.setDomainList([]); }; /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.xray.app.router.GeoSiteList.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.app.router.GeoSiteList.prototype.toObject = function(opt_includeInstance) { return proto.xray.app.router.GeoSiteList.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.app.router.GeoSiteList} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.xray.app.router.GeoSiteList.toObject = function(includeInstance, msg) { var f, obj = { entryList: jspb.Message.toObjectList(msg.getEntryList(), proto.xray.app.router.GeoSite.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.app.router.GeoSiteList} */ proto.xray.app.router.GeoSiteList.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.xray.app.router.GeoSiteList; return proto.xray.app.router.GeoSiteList.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.xray.app.router.GeoSiteList} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @r