xray-grpc
Version:
GRPC client for xray.
250 lines (218 loc) • 7.43 kB
JavaScript
// source: proxy/shadowsocks.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.proxy.shadowsocks.Account', null, global);
goog.exportSymbol('proto.xray.proxy.shadowsocks.CipherType', 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.proxy.shadowsocks.Account = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.xray.proxy.shadowsocks.Account, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.xray.proxy.shadowsocks.Account.displayName = 'proto.xray.proxy.shadowsocks.Account';
}
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.proxy.shadowsocks.Account.prototype.toObject = function(opt_includeInstance) {
return proto.xray.proxy.shadowsocks.Account.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.proxy.shadowsocks.Account} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.proxy.shadowsocks.Account.toObject = function(includeInstance, msg) {
var f, obj = {
password: jspb.Message.getFieldWithDefault(msg, 1, ""),
cipherType: jspb.Message.getFieldWithDefault(msg, 2, 0),
ivCheck: 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.proxy.shadowsocks.Account}
*/
proto.xray.proxy.shadowsocks.Account.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.xray.proxy.shadowsocks.Account;
return proto.xray.proxy.shadowsocks.Account.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.xray.proxy.shadowsocks.Account} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.xray.proxy.shadowsocks.Account}
*/
proto.xray.proxy.shadowsocks.Account.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.setPassword(value);
break;
case 2:
var value = /** @type {!proto.xray.proxy.shadowsocks.CipherType} */ (reader.readEnum());
msg.setCipherType(value);
break;
case 3:
var value = /** @type {boolean} */ (reader.readBool());
msg.setIvCheck(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.xray.proxy.shadowsocks.Account.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.xray.proxy.shadowsocks.Account.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.proxy.shadowsocks.Account} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.xray.proxy.shadowsocks.Account.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPassword();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getCipherType();
if (f !== 0.0) {
writer.writeEnum(
2,
f
);
}
f = message.getIvCheck();
if (f) {
writer.writeBool(
3,
f
);
}
};
/**
* optional string password = 1;
* @return {string}
*/
proto.xray.proxy.shadowsocks.Account.prototype.getPassword = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.xray.proxy.shadowsocks.Account} returns this
*/
proto.xray.proxy.shadowsocks.Account.prototype.setPassword = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional CipherType cipher_type = 2;
* @return {!proto.xray.proxy.shadowsocks.CipherType}
*/
proto.xray.proxy.shadowsocks.Account.prototype.getCipherType = function() {
return /** @type {!proto.xray.proxy.shadowsocks.CipherType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
};
/**
* @param {!proto.xray.proxy.shadowsocks.CipherType} value
* @return {!proto.xray.proxy.shadowsocks.Account} returns this
*/
proto.xray.proxy.shadowsocks.Account.prototype.setCipherType = function(value) {
return jspb.Message.setProto3EnumField(this, 2, value);
};
/**
* optional bool iv_check = 3;
* @return {boolean}
*/
proto.xray.proxy.shadowsocks.Account.prototype.getIvCheck = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
};
/**
* @param {boolean} value
* @return {!proto.xray.proxy.shadowsocks.Account} returns this
*/
proto.xray.proxy.shadowsocks.Account.prototype.setIvCheck = function(value) {
return jspb.Message.setProto3BooleanField(this, 3, value);
};
/**
* @enum {number}
*/
proto.xray.proxy.shadowsocks.CipherType = {
UNKNOWN: 0,
AES_128_GCM: 5,
AES_256_GCM: 6,
CHACHA20_POLY1305: 7,
XCHACHA20_POLY1305: 8,
NONE: 9
};
goog.object.extend(exports, proto.xray.proxy.shadowsocks);