UNPKG

hyperdrive-daemon-client

Version:

A client library and CLI tool for interacting with the Hyperdrive daemon.

629 lines (537 loc) 17.4 kB
/** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.StatusRequest', null, global); goog.exportSymbol('proto.StatusResponse', 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.StatusRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.StatusRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.StatusRequest.displayName = 'proto.StatusRequest'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.StatusRequest.prototype.toObject = function(opt_includeInstance) { return proto.StatusRequest.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.StatusRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.StatusRequest.toObject = function(includeInstance, msg) { var f, obj = { }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.StatusRequest} */ proto.StatusRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.StatusRequest; return proto.StatusRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.StatusRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.StatusRequest} */ proto.StatusRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.StatusRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.StatusRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.StatusRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.StatusRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; }; /** * 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.StatusResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.StatusResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.StatusResponse.displayName = 'proto.StatusResponse'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.StatusResponse.prototype.toObject = function(opt_includeInstance) { return proto.StatusResponse.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.StatusResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.StatusResponse.toObject = function(includeInstance, msg) { var f, obj = { apiversion: jspb.Message.getFieldWithDefault(msg, 1, 0), daemonversion: jspb.Message.getFieldWithDefault(msg, 2, ""), clientversion: jspb.Message.getFieldWithDefault(msg, 3, ""), schemaversion: jspb.Message.getFieldWithDefault(msg, 4, ""), hyperdriveversion: jspb.Message.getFieldWithDefault(msg, 5, ""), fusenativeversion: jspb.Message.getFieldWithDefault(msg, 6, ""), hyperdrivefuseversion: jspb.Message.getFieldWithDefault(msg, 7, ""), uptime: jspb.Message.getFieldWithDefault(msg, 8, 0), holepunchable: jspb.Message.getFieldWithDefault(msg, 9, false), remoteaddress: jspb.Message.getFieldWithDefault(msg, 10, ""), fuseavailable: jspb.Message.getFieldWithDefault(msg, 11, false), fuseconfigured: jspb.Message.getFieldWithDefault(msg, 12, false), noisekey: msg.getNoisekey_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.StatusResponse} */ proto.StatusResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.StatusResponse; return proto.StatusResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.StatusResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.StatusResponse} */ proto.StatusResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readUint64()); msg.setApiversion(value); break; case 2: var value = /** @type {string} */ (reader.readString()); msg.setDaemonversion(value); break; case 3: var value = /** @type {string} */ (reader.readString()); msg.setClientversion(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setSchemaversion(value); break; case 5: var value = /** @type {string} */ (reader.readString()); msg.setHyperdriveversion(value); break; case 6: var value = /** @type {string} */ (reader.readString()); msg.setFusenativeversion(value); break; case 7: var value = /** @type {string} */ (reader.readString()); msg.setHyperdrivefuseversion(value); break; case 8: var value = /** @type {number} */ (reader.readUint64()); msg.setUptime(value); break; case 9: var value = /** @type {boolean} */ (reader.readBool()); msg.setHolepunchable(value); break; case 10: var value = /** @type {string} */ (reader.readString()); msg.setRemoteaddress(value); break; case 11: var value = /** @type {boolean} */ (reader.readBool()); msg.setFuseavailable(value); break; case 12: var value = /** @type {boolean} */ (reader.readBool()); msg.setFuseconfigured(value); break; case 13: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setNoisekey(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.StatusResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.StatusResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.StatusResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.StatusResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getApiversion(); if (f !== 0) { writer.writeUint64( 1, f ); } f = message.getDaemonversion(); if (f.length > 0) { writer.writeString( 2, f ); } f = message.getClientversion(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getSchemaversion(); if (f.length > 0) { writer.writeString( 4, f ); } f = message.getHyperdriveversion(); if (f.length > 0) { writer.writeString( 5, f ); } f = message.getFusenativeversion(); if (f.length > 0) { writer.writeString( 6, f ); } f = message.getHyperdrivefuseversion(); if (f.length > 0) { writer.writeString( 7, f ); } f = message.getUptime(); if (f !== 0) { writer.writeUint64( 8, f ); } f = message.getHolepunchable(); if (f) { writer.writeBool( 9, f ); } f = message.getRemoteaddress(); if (f.length > 0) { writer.writeString( 10, f ); } f = message.getFuseavailable(); if (f) { writer.writeBool( 11, f ); } f = message.getFuseconfigured(); if (f) { writer.writeBool( 12, f ); } f = message.getNoisekey_asU8(); if (f.length > 0) { writer.writeBytes( 13, f ); } }; /** * optional uint64 apiVersion = 1; * @return {number} */ proto.StatusResponse.prototype.getApiversion = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** @param {number} value */ proto.StatusResponse.prototype.setApiversion = function(value) { jspb.Message.setProto3IntField(this, 1, value); }; /** * optional string daemonVersion = 2; * @return {string} */ proto.StatusResponse.prototype.getDaemonversion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setDaemonversion = function(value) { jspb.Message.setProto3StringField(this, 2, value); }; /** * optional string clientVersion = 3; * @return {string} */ proto.StatusResponse.prototype.getClientversion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setClientversion = function(value) { jspb.Message.setProto3StringField(this, 3, value); }; /** * optional string schemaVersion = 4; * @return {string} */ proto.StatusResponse.prototype.getSchemaversion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setSchemaversion = function(value) { jspb.Message.setProto3StringField(this, 4, value); }; /** * optional string hyperdriveVersion = 5; * @return {string} */ proto.StatusResponse.prototype.getHyperdriveversion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setHyperdriveversion = function(value) { jspb.Message.setProto3StringField(this, 5, value); }; /** * optional string fuseNativeVersion = 6; * @return {string} */ proto.StatusResponse.prototype.getFusenativeversion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setFusenativeversion = function(value) { jspb.Message.setProto3StringField(this, 6, value); }; /** * optional string hyperdriveFuseVersion = 7; * @return {string} */ proto.StatusResponse.prototype.getHyperdrivefuseversion = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setHyperdrivefuseversion = function(value) { jspb.Message.setProto3StringField(this, 7, value); }; /** * optional uint64 uptime = 8; * @return {number} */ proto.StatusResponse.prototype.getUptime = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0)); }; /** @param {number} value */ proto.StatusResponse.prototype.setUptime = function(value) { jspb.Message.setProto3IntField(this, 8, value); }; /** * optional bool holepunchable = 9; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.StatusResponse.prototype.getHolepunchable = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 9, false)); }; /** @param {boolean} value */ proto.StatusResponse.prototype.setHolepunchable = function(value) { jspb.Message.setProto3BooleanField(this, 9, value); }; /** * optional string remoteAddress = 10; * @return {string} */ proto.StatusResponse.prototype.getRemoteaddress = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 10, "")); }; /** @param {string} value */ proto.StatusResponse.prototype.setRemoteaddress = function(value) { jspb.Message.setProto3StringField(this, 10, value); }; /** * optional bool fuseAvailable = 11; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.StatusResponse.prototype.getFuseavailable = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 11, false)); }; /** @param {boolean} value */ proto.StatusResponse.prototype.setFuseavailable = function(value) { jspb.Message.setProto3BooleanField(this, 11, value); }; /** * optional bool fuseConfigured = 12; * Note that Boolean fields may be set to 0/1 when serialized from a Java server. * You should avoid comparisons like {@code val === true/false} in those cases. * @return {boolean} */ proto.StatusResponse.prototype.getFuseconfigured = function() { return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 12, false)); }; /** @param {boolean} value */ proto.StatusResponse.prototype.setFuseconfigured = function(value) { jspb.Message.setProto3BooleanField(this, 12, value); }; /** * optional bytes noiseKey = 13; * @return {!(string|Uint8Array)} */ proto.StatusResponse.prototype.getNoisekey = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 13, "")); }; /** * optional bytes noiseKey = 13; * This is a type-conversion wrapper around `getNoisekey()` * @return {string} */ proto.StatusResponse.prototype.getNoisekey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getNoisekey())); }; /** * optional bytes noiseKey = 13; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getNoisekey()` * @return {!Uint8Array} */ proto.StatusResponse.prototype.getNoisekey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getNoisekey())); }; /** @param {!(string|Uint8Array)} value */ proto.StatusResponse.prototype.setNoisekey = function(value) { jspb.Message.setProto3BytesField(this, 13, value); }; goog.object.extend(exports, proto);