xray-grpc
Version:
GRPC client for xray.
989 lines (849 loc) • 30.8 kB
JavaScript
// source: core/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 transport_global_config_pb = require('../transport/global/config_pb.js');
goog.object.extend(proto, transport_global_config_pb);
goog.exportSymbol('proto.xray.core.Config', null, global);
goog.exportSymbol('proto.xray.core.InboundHandlerConfig', null, global);
goog.exportSymbol('proto.xray.core.OutboundHandlerConfig', 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.core.Config = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.xray.core.Config.repeatedFields_, null);
};
goog.inherits(proto.xray.core.Config, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.xray.core.Config.displayName = 'proto.xray.core.Config';
}
/**
* 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.core.InboundHandlerConfig = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xray.core.InboundHandlerConfig, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.xray.core.InboundHandlerConfig.displayName = 'proto.xray.core.InboundHandlerConfig';
}
/**
* 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.core.OutboundHandlerConfig = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xray.core.OutboundHandlerConfig, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.xray.core.OutboundHandlerConfig.displayName = 'proto.xray.core.OutboundHandlerConfig';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.xray.core.Config.repeatedFields_ = [1,2,4,6];
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.core.Config.prototype.toObject = function(opt_includeInstance) {
return proto.xray.core.Config.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.core.Config} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.core.Config.toObject = function(includeInstance, msg) {
var f, obj = {
inboundList: jspb.Message.toObjectList(msg.getInboundList(),
proto.xray.core.InboundHandlerConfig.toObject, includeInstance),
outboundList: jspb.Message.toObjectList(msg.getOutboundList(),
proto.xray.core.OutboundHandlerConfig.toObject, includeInstance),
appList: jspb.Message.toObjectList(msg.getAppList(),
common_serial_typed_message_pb.TypedMessage.toObject, includeInstance),
transport: (f = msg.getTransport()) && transport_global_config_pb.Config.toObject(includeInstance, f),
extensionList: jspb.Message.toObjectList(msg.getExtensionList(),
common_serial_typed_message_pb.TypedMessage.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.core.Config}
*/
proto.xray.core.Config.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xray.core.Config;
return proto.xray.core.Config.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xray.core.Config} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xray.core.Config}
*/
proto.xray.core.Config.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.xray.core.InboundHandlerConfig;
reader.readMessage(value,proto.xray.core.InboundHandlerConfig.deserializeBinaryFromReader);
msg.addInbound(value);
break;
case 2:
var value = new proto.xray.core.OutboundHandlerConfig;
reader.readMessage(value,proto.xray.core.OutboundHandlerConfig.deserializeBinaryFromReader);
msg.addOutbound(value);
break;
case 4:
var value = new common_serial_typed_message_pb.TypedMessage;
reader.readMessage(value,common_serial_typed_message_pb.TypedMessage.deserializeBinaryFromReader);
msg.addApp(value);
break;
case 5:
var value = new transport_global_config_pb.Config;
reader.readMessage(value,transport_global_config_pb.Config.deserializeBinaryFromReader);
msg.setTransport(value);
break;
case 6:
var value = new common_serial_typed_message_pb.TypedMessage;
reader.readMessage(value,common_serial_typed_message_pb.TypedMessage.deserializeBinaryFromReader);
msg.addExtension$(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xray.core.Config.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xray.core.Config.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.core.Config} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.core.Config.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getInboundList();
if (f.length > 0) {
writer.writeRepeatedMessage(
1,
f,
proto.xray.core.InboundHandlerConfig.serializeBinaryToWriter
);
}
f = message.getOutboundList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.xray.core.OutboundHandlerConfig.serializeBinaryToWriter
);
}
f = message.getAppList();
if (f.length > 0) {
writer.writeRepeatedMessage(
4,
f,
common_serial_typed_message_pb.TypedMessage.serializeBinaryToWriter
);
}
f = message.getTransport();
if (f != null) {
writer.writeMessage(
5,
f,
transport_global_config_pb.Config.serializeBinaryToWriter
);
}
f = message.getExtensionList();
if (f.length > 0) {
writer.writeRepeatedMessage(
6,
f,
common_serial_typed_message_pb.TypedMessage.serializeBinaryToWriter
);
}
};
/**
* repeated InboundHandlerConfig inbound = 1;
* @return {!Array<!proto.xray.core.InboundHandlerConfig>}
*/
proto.xray.core.Config.prototype.getInboundList = function() {
return /** @type{!Array<!proto.xray.core.InboundHandlerConfig>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.xray.core.InboundHandlerConfig, 1));
};
/**
* @param {!Array<!proto.xray.core.InboundHandlerConfig>} value
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.setInboundList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 1, value);
};
/**
* @param {!proto.xray.core.InboundHandlerConfig=} opt_value
* @param {number=} opt_index
* @return {!proto.xray.core.InboundHandlerConfig}
*/
proto.xray.core.Config.prototype.addInbound = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.xray.core.InboundHandlerConfig, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.clearInboundList = function() {
return this.setInboundList([]);
};
/**
* repeated OutboundHandlerConfig outbound = 2;
* @return {!Array<!proto.xray.core.OutboundHandlerConfig>}
*/
proto.xray.core.Config.prototype.getOutboundList = function() {
return /** @type{!Array<!proto.xray.core.OutboundHandlerConfig>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.xray.core.OutboundHandlerConfig, 2));
};
/**
* @param {!Array<!proto.xray.core.OutboundHandlerConfig>} value
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.setOutboundList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.xray.core.OutboundHandlerConfig=} opt_value
* @param {number=} opt_index
* @return {!proto.xray.core.OutboundHandlerConfig}
*/
proto.xray.core.Config.prototype.addOutbound = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.xray.core.OutboundHandlerConfig, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.clearOutboundList = function() {
return this.setOutboundList([]);
};
/**
* repeated xray.common.serial.TypedMessage app = 4;
* @return {!Array<!proto.xray.common.serial.TypedMessage>}
*/
proto.xray.core.Config.prototype.getAppList = function() {
return /** @type{!Array<!proto.xray.common.serial.TypedMessage>} */ (
jspb.Message.getRepeatedWrapperField(this, common_serial_typed_message_pb.TypedMessage, 4));
};
/**
* @param {!Array<!proto.xray.common.serial.TypedMessage>} value
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.setAppList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
};
/**
* @param {!proto.xray.common.serial.TypedMessage=} opt_value
* @param {number=} opt_index
* @return {!proto.xray.common.serial.TypedMessage}
*/
proto.xray.core.Config.prototype.addApp = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.xray.common.serial.TypedMessage, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.clearAppList = function() {
return this.setAppList([]);
};
/**
* optional xray.transport.Config transport = 5;
* @return {?proto.xray.transport.Config}
*/
proto.xray.core.Config.prototype.getTransport = function() {
return /** @type{?proto.xray.transport.Config} */ (
jspb.Message.getWrapperField(this, transport_global_config_pb.Config, 5));
};
/**
* @param {?proto.xray.transport.Config|undefined} value
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.setTransport = function(value) {
return jspb.Message.setWrapperField(this, 5, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.clearTransport = function() {
return this.setTransport(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xray.core.Config.prototype.hasTransport = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* repeated xray.common.serial.TypedMessage extension = 6;
* @return {!Array<!proto.xray.common.serial.TypedMessage>}
*/
proto.xray.core.Config.prototype.getExtensionList = function() {
return /** @type{!Array<!proto.xray.common.serial.TypedMessage>} */ (
jspb.Message.getRepeatedWrapperField(this, common_serial_typed_message_pb.TypedMessage, 6));
};
/**
* @param {!Array<!proto.xray.common.serial.TypedMessage>} value
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.setExtensionList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 6, value);
};
/**
* @param {!proto.xray.common.serial.TypedMessage=} opt_value
* @param {number=} opt_index
* @return {!proto.xray.common.serial.TypedMessage}
*/
proto.xray.core.Config.prototype.addExtension$ = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.xray.common.serial.TypedMessage, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.xray.core.Config} returns this
*/
proto.xray.core.Config.prototype.clearExtensionList = function() {
return this.setExtensionList([]);
};
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.core.InboundHandlerConfig.prototype.toObject = function(opt_includeInstance) {
return proto.xray.core.InboundHandlerConfig.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.core.InboundHandlerConfig} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.core.InboundHandlerConfig.toObject = function(includeInstance, msg) {
var f, obj = {
tag: jspb.Message.getFieldWithDefault(msg, 1, ""),
receiverSettings: (f = msg.getReceiverSettings()) && common_serial_typed_message_pb.TypedMessage.toObject(includeInstance, f),
proxySettings: (f = msg.getProxySettings()) && common_serial_typed_message_pb.TypedMessage.toObject(includeInstance, f)
};
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.core.InboundHandlerConfig}
*/
proto.xray.core.InboundHandlerConfig.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xray.core.InboundHandlerConfig;
return proto.xray.core.InboundHandlerConfig.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xray.core.InboundHandlerConfig} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xray.core.InboundHandlerConfig}
*/
proto.xray.core.InboundHandlerConfig.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.setTag(value);
break;
case 2:
var value = new common_serial_typed_message_pb.TypedMessage;
reader.readMessage(value,common_serial_typed_message_pb.TypedMessage.deserializeBinaryFromReader);
msg.setReceiverSettings(value);
break;
case 3:
var value = new common_serial_typed_message_pb.TypedMessage;
reader.readMessage(value,common_serial_typed_message_pb.TypedMessage.deserializeBinaryFromReader);
msg.setProxySettings(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xray.core.InboundHandlerConfig.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xray.core.InboundHandlerConfig.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.core.InboundHandlerConfig} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.core.InboundHandlerConfig.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTag();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getReceiverSettings();
if (f != null) {
writer.writeMessage(
2,
f,
common_serial_typed_message_pb.TypedMessage.serializeBinaryToWriter
);
}
f = message.getProxySettings();
if (f != null) {
writer.writeMessage(
3,
f,
common_serial_typed_message_pb.TypedMessage.serializeBinaryToWriter
);
}
};
/**
* optional string tag = 1;
* @return {string}
*/
proto.xray.core.InboundHandlerConfig.prototype.getTag = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.xray.core.InboundHandlerConfig} returns this
*/
proto.xray.core.InboundHandlerConfig.prototype.setTag = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional xray.common.serial.TypedMessage receiver_settings = 2;
* @return {?proto.xray.common.serial.TypedMessage}
*/
proto.xray.core.InboundHandlerConfig.prototype.getReceiverSettings = function() {
return /** @type{?proto.xray.common.serial.TypedMessage} */ (
jspb.Message.getWrapperField(this, common_serial_typed_message_pb.TypedMessage, 2));
};
/**
* @param {?proto.xray.common.serial.TypedMessage|undefined} value
* @return {!proto.xray.core.InboundHandlerConfig} returns this
*/
proto.xray.core.InboundHandlerConfig.prototype.setReceiverSettings = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.xray.core.InboundHandlerConfig} returns this
*/
proto.xray.core.InboundHandlerConfig.prototype.clearReceiverSettings = function() {
return this.setReceiverSettings(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xray.core.InboundHandlerConfig.prototype.hasReceiverSettings = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional xray.common.serial.TypedMessage proxy_settings = 3;
* @return {?proto.xray.common.serial.TypedMessage}
*/
proto.xray.core.InboundHandlerConfig.prototype.getProxySettings = function() {
return /** @type{?proto.xray.common.serial.TypedMessage} */ (
jspb.Message.getWrapperField(this, common_serial_typed_message_pb.TypedMessage, 3));
};
/**
* @param {?proto.xray.common.serial.TypedMessage|undefined} value
* @return {!proto.xray.core.InboundHandlerConfig} returns this
*/
proto.xray.core.InboundHandlerConfig.prototype.setProxySettings = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.xray.core.InboundHandlerConfig} returns this
*/
proto.xray.core.InboundHandlerConfig.prototype.clearProxySettings = function() {
return this.setProxySettings(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xray.core.InboundHandlerConfig.prototype.hasProxySettings = function() {
return jspb.Message.getField(this, 3) != null;
};
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.core.OutboundHandlerConfig.prototype.toObject = function(opt_includeInstance) {
return proto.xray.core.OutboundHandlerConfig.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.core.OutboundHandlerConfig} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.core.OutboundHandlerConfig.toObject = function(includeInstance, msg) {
var f, obj = {
tag: jspb.Message.getFieldWithDefault(msg, 1, ""),
senderSettings: (f = msg.getSenderSettings()) && common_serial_typed_message_pb.TypedMessage.toObject(includeInstance, f),
proxySettings: (f = msg.getProxySettings()) && common_serial_typed_message_pb.TypedMessage.toObject(includeInstance, f),
expire: jspb.Message.getFieldWithDefault(msg, 4, 0),
comment: jspb.Message.getFieldWithDefault(msg, 5, "")
};
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.core.OutboundHandlerConfig}
*/
proto.xray.core.OutboundHandlerConfig.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xray.core.OutboundHandlerConfig;
return proto.xray.core.OutboundHandlerConfig.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xray.core.OutboundHandlerConfig} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xray.core.OutboundHandlerConfig}
*/
proto.xray.core.OutboundHandlerConfig.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.setTag(value);
break;
case 2:
var value = new common_serial_typed_message_pb.TypedMessage;
reader.readMessage(value,common_serial_typed_message_pb.TypedMessage.deserializeBinaryFromReader);
msg.setSenderSettings(value);
break;
case 3:
var value = new common_serial_typed_message_pb.TypedMessage;
reader.readMessage(value,common_serial_typed_message_pb.TypedMessage.deserializeBinaryFromReader);
msg.setProxySettings(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt64());
msg.setExpire(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setComment(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xray.core.OutboundHandlerConfig.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xray.core.OutboundHandlerConfig.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.core.OutboundHandlerConfig} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.core.OutboundHandlerConfig.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTag();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getSenderSettings();
if (f != null) {
writer.writeMessage(
2,
f,
common_serial_typed_message_pb.TypedMessage.serializeBinaryToWriter
);
}
f = message.getProxySettings();
if (f != null) {
writer.writeMessage(
3,
f,
common_serial_typed_message_pb.TypedMessage.serializeBinaryToWriter
);
}
f = message.getExpire();
if (f !== 0) {
writer.writeInt64(
4,
f
);
}
f = message.getComment();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
};
/**
* optional string tag = 1;
* @return {string}
*/
proto.xray.core.OutboundHandlerConfig.prototype.getTag = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.setTag = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional xray.common.serial.TypedMessage sender_settings = 2;
* @return {?proto.xray.common.serial.TypedMessage}
*/
proto.xray.core.OutboundHandlerConfig.prototype.getSenderSettings = function() {
return /** @type{?proto.xray.common.serial.TypedMessage} */ (
jspb.Message.getWrapperField(this, common_serial_typed_message_pb.TypedMessage, 2));
};
/**
* @param {?proto.xray.common.serial.TypedMessage|undefined} value
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.setSenderSettings = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.clearSenderSettings = function() {
return this.setSenderSettings(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xray.core.OutboundHandlerConfig.prototype.hasSenderSettings = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional xray.common.serial.TypedMessage proxy_settings = 3;
* @return {?proto.xray.common.serial.TypedMessage}
*/
proto.xray.core.OutboundHandlerConfig.prototype.getProxySettings = function() {
return /** @type{?proto.xray.common.serial.TypedMessage} */ (
jspb.Message.getWrapperField(this, common_serial_typed_message_pb.TypedMessage, 3));
};
/**
* @param {?proto.xray.common.serial.TypedMessage|undefined} value
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.setProxySettings = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.clearProxySettings = function() {
return this.setProxySettings(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.xray.core.OutboundHandlerConfig.prototype.hasProxySettings = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional int64 expire = 4;
* @return {number}
*/
proto.xray.core.OutboundHandlerConfig.prototype.getExpire = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.setExpire = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
/**
* optional string comment = 5;
* @return {string}
*/
proto.xray.core.OutboundHandlerConfig.prototype.getComment = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.xray.core.OutboundHandlerConfig} returns this
*/
proto.xray.core.OutboundHandlerConfig.prototype.setComment = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
goog.object.extend(exports, proto.xray.core);