UNPKG

@x5e/gink

Version:

an eventually consistent database

413 lines 15.5 kB
// source: log_file.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.google.gink.LogFile', null, global); goog.exportSymbol('proto.google.gink.LogFile.ChainEntry', 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.google.gink.LogFile = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.google.gink.LogFile.repeatedFields_, null); }; goog.inherits(proto.google.gink.LogFile, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.google.gink.LogFile.displayName = 'proto.google.gink.LogFile'; } /** * 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.google.gink.LogFile.ChainEntry = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.google.gink.LogFile.ChainEntry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.google.gink.LogFile.ChainEntry.displayName = 'proto.google.gink.LogFile.ChainEntry'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.google.gink.LogFile.repeatedFields_ = [1, 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.google.gink.LogFile.prototype.toObject = function (opt_includeInstance) { return proto.google.gink.LogFile.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.google.gink.LogFile} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.gink.LogFile.toObject = function (includeInstance, msg) { var f, obj = { commitsList: msg.getCommitsList_asB64(), chainEntriesList: jspb.Message.toObjectList(msg.getChainEntriesList(), proto.google.gink.LogFile.ChainEntry.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.google.gink.LogFile} */ proto.google.gink.LogFile.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.google.gink.LogFile; return proto.google.gink.LogFile.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.google.gink.LogFile} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.google.gink.LogFile} */ proto.google.gink.LogFile.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.addCommits(value); break; case 2: var value = new proto.google.gink.LogFile.ChainEntry; reader.readMessage(value, proto.google.gink.LogFile.ChainEntry.deserializeBinaryFromReader); msg.addChainEntries(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.google.gink.LogFile.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.google.gink.LogFile.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.google.gink.LogFile} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.gink.LogFile.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getCommitsList_asU8(); if (f.length > 0) { writer.writeRepeatedBytes(1, f); } f = message.getChainEntriesList(); if (f.length > 0) { writer.writeRepeatedMessage(2, f, proto.google.gink.LogFile.ChainEntry.serializeBinaryToWriter); } }; 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.google.gink.LogFile.ChainEntry.prototype.toObject = function (opt_includeInstance) { return proto.google.gink.LogFile.ChainEntry.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.google.gink.LogFile.ChainEntry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.gink.LogFile.ChainEntry.toObject = function (includeInstance, msg) { var f, obj = { medallion: jspb.Message.getFieldWithDefault(msg, 1, 0), chainStart: jspb.Message.getFieldWithDefault(msg, 2, 0), chainEnd: 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.google.gink.LogFile.ChainEntry} */ proto.google.gink.LogFile.ChainEntry.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.google.gink.LogFile.ChainEntry; return proto.google.gink.LogFile.ChainEntry.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.google.gink.LogFile.ChainEntry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.google.gink.LogFile.ChainEntry} */ proto.google.gink.LogFile.ChainEntry.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.setMedallion(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setChainStart(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setChainEnd(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.google.gink.LogFile.ChainEntry.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.google.gink.LogFile.ChainEntry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.google.gink.LogFile.ChainEntry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.google.gink.LogFile.ChainEntry.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getMedallion(); if (f !== 0) { writer.writeUint64(1, f); } f = message.getChainStart(); if (f !== 0) { writer.writeUint64(2, f); } f = message.getChainEnd(); if (f !== 0) { writer.writeUint64(3, f); } }; /** * optional uint64 medallion = 1; * @return {number} */ proto.google.gink.LogFile.ChainEntry.prototype.getMedallion = function () { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.google.gink.LogFile.ChainEntry} returns this */ proto.google.gink.LogFile.ChainEntry.prototype.setMedallion = function (value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional uint64 chain_start = 2; * @return {number} */ proto.google.gink.LogFile.ChainEntry.prototype.getChainStart = function () { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.google.gink.LogFile.ChainEntry} returns this */ proto.google.gink.LogFile.ChainEntry.prototype.setChainStart = function (value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 chain_end = 3; * @return {number} */ proto.google.gink.LogFile.ChainEntry.prototype.getChainEnd = function () { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.google.gink.LogFile.ChainEntry} returns this */ proto.google.gink.LogFile.ChainEntry.prototype.setChainEnd = function (value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * repeated bytes commits = 1; * @return {!(Array<!Uint8Array>|Array<string>)} */ proto.google.gink.LogFile.prototype.getCommitsList = function () { return /** @type {!(Array<!Uint8Array>|Array<string>)} */ (jspb.Message.getRepeatedField(this, 1)); }; /** * repeated bytes commits = 1; * This is a type-conversion wrapper around `getCommitsList()` * @return {!Array<string>} */ proto.google.gink.LogFile.prototype.getCommitsList_asB64 = function () { return /** @type {!Array<string>} */ (jspb.Message.bytesListAsB64(this.getCommitsList())); }; /** * repeated bytes commits = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCommitsList()` * @return {!Array<!Uint8Array>} */ proto.google.gink.LogFile.prototype.getCommitsList_asU8 = function () { return /** @type {!Array<!Uint8Array>} */ (jspb.Message.bytesListAsU8(this.getCommitsList())); }; /** * @param {!(Array<!Uint8Array>|Array<string>)} value * @return {!proto.google.gink.LogFile} returns this */ proto.google.gink.LogFile.prototype.setCommitsList = function (value) { return jspb.Message.setField(this, 1, value || []); }; /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index * @return {!proto.google.gink.LogFile} returns this */ proto.google.gink.LogFile.prototype.addCommits = function (value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.google.gink.LogFile} returns this */ proto.google.gink.LogFile.prototype.clearCommitsList = function () { return this.setCommitsList([]); }; /** * repeated ChainEntry chain_entries = 2; * @return {!Array<!proto.google.gink.LogFile.ChainEntry>} */ proto.google.gink.LogFile.prototype.getChainEntriesList = function () { return /** @type{!Array<!proto.google.gink.LogFile.ChainEntry>} */ (jspb.Message.getRepeatedWrapperField(this, proto.google.gink.LogFile.ChainEntry, 2)); }; /** * @param {!Array<!proto.google.gink.LogFile.ChainEntry>} value * @return {!proto.google.gink.LogFile} returns this */ proto.google.gink.LogFile.prototype.setChainEntriesList = function (value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.google.gink.LogFile.ChainEntry=} opt_value * @param {number=} opt_index * @return {!proto.google.gink.LogFile.ChainEntry} */ proto.google.gink.LogFile.prototype.addChainEntries = function (opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.google.gink.LogFile.ChainEntry, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.google.gink.LogFile} returns this */ proto.google.gink.LogFile.prototype.clearChainEntriesList = function () { return this.setChainEntriesList([]); }; goog.object.extend(exports, proto.google.gink); //# sourceMappingURL=log_file_pb.js.map