@kurrent/kurrentdb-client
Version:
KurrentDB gRPC NodeJS Client SDK
362 lines (315 loc) • 12.1 kB
JavaScript
// source: monitoring.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.event_store.client.monitoring.StatsReq', null, global);
goog.exportSymbol('proto.event_store.client.monitoring.StatsResp', 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.event_store.client.monitoring.StatsReq = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.event_store.client.monitoring.StatsReq, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.event_store.client.monitoring.StatsReq.displayName = 'proto.event_store.client.monitoring.StatsReq';
}
/**
* 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.event_store.client.monitoring.StatsResp = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.event_store.client.monitoring.StatsResp, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.event_store.client.monitoring.StatsResp.displayName = 'proto.event_store.client.monitoring.StatsResp';
}
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.event_store.client.monitoring.StatsReq.prototype.toObject = function(opt_includeInstance) {
return proto.event_store.client.monitoring.StatsReq.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.event_store.client.monitoring.StatsReq} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.event_store.client.monitoring.StatsReq.toObject = function(includeInstance, msg) {
var f, obj = {
useMetadata: jspb.Message.getBooleanFieldWithDefault(msg, 1, false),
refreshTimePeriodInMs: jspb.Message.getFieldWithDefault(msg, 4, "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.event_store.client.monitoring.StatsReq}
*/
proto.event_store.client.monitoring.StatsReq.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.event_store.client.monitoring.StatsReq;
return proto.event_store.client.monitoring.StatsReq.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.event_store.client.monitoring.StatsReq} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.event_store.client.monitoring.StatsReq}
*/
proto.event_store.client.monitoring.StatsReq.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {boolean} */ (reader.readBool());
msg.setUseMetadata(value);
break;
case 4:
var value = /** @type {string} */ (reader.readUint64String());
msg.setRefreshTimePeriodInMs(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.event_store.client.monitoring.StatsReq.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.event_store.client.monitoring.StatsReq.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.event_store.client.monitoring.StatsReq} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.event_store.client.monitoring.StatsReq.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUseMetadata();
if (f) {
writer.writeBool(
1,
f
);
}
f = message.getRefreshTimePeriodInMs();
if (parseInt(f, 10) !== 0) {
writer.writeUint64String(
4,
f
);
}
};
/**
* optional bool use_metadata = 1;
* @return {boolean}
*/
proto.event_store.client.monitoring.StatsReq.prototype.getUseMetadata = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
};
/**
* @param {boolean} value
* @return {!proto.event_store.client.monitoring.StatsReq} returns this
*/
proto.event_store.client.monitoring.StatsReq.prototype.setUseMetadata = function(value) {
return jspb.Message.setProto3BooleanField(this, 1, value);
};
/**
* optional uint64 refresh_time_period_in_ms = 4;
* @return {string}
*/
proto.event_store.client.monitoring.StatsReq.prototype.getRefreshTimePeriodInMs = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "0"));
};
/**
* @param {string} value
* @return {!proto.event_store.client.monitoring.StatsReq} returns this
*/
proto.event_store.client.monitoring.StatsReq.prototype.setRefreshTimePeriodInMs = function(value) {
return jspb.Message.setProto3StringIntField(this, 4, value);
};
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.event_store.client.monitoring.StatsResp.prototype.toObject = function(opt_includeInstance) {
return proto.event_store.client.monitoring.StatsResp.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.event_store.client.monitoring.StatsResp} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.event_store.client.monitoring.StatsResp.toObject = function(includeInstance, msg) {
var f, obj = {
statsMap: (f = msg.getStatsMap()) ? f.toObject(includeInstance, undefined) : []
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.event_store.client.monitoring.StatsResp}
*/
proto.event_store.client.monitoring.StatsResp.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.event_store.client.monitoring.StatsResp;
return proto.event_store.client.monitoring.StatsResp.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.event_store.client.monitoring.StatsResp} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.event_store.client.monitoring.StatsResp}
*/
proto.event_store.client.monitoring.StatsResp.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = msg.getStatsMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
});
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.event_store.client.monitoring.StatsResp.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.event_store.client.monitoring.StatsResp.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.event_store.client.monitoring.StatsResp} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.event_store.client.monitoring.StatsResp.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getStatsMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
}
};
/**
* map<string, string> stats = 1;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,string>}
*/
proto.event_store.client.monitoring.StatsResp.prototype.getStatsMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,string>} */ (
jspb.Message.getMapField(this, 1, opt_noLazyCreate,
null));
};
/**
* Clears values from the map. The map will be non-null.
* @return {!proto.event_store.client.monitoring.StatsResp} returns this
*/
proto.event_store.client.monitoring.StatsResp.prototype.clearStatsMap = function() {
this.getStatsMap().clear();
return this;};
goog.object.extend(exports, proto.event_store.client.monitoring);