1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

Remove BaseMsg from msg.proto

This commit is contained in:
Ryan Dahl 2018-06-23 13:24:53 +02:00
parent cf07ec5b63
commit 92d01f8519
3 changed files with 0 additions and 315 deletions

96
js/msg.pb.d.ts vendored
View file

@ -3,102 +3,6 @@ import * as $protobuf from "protobufjs";
/** Namespace deno. */
export namespace deno {
/** Properties of a BaseMsg. */
interface IBaseMsg {
/** BaseMsg channel */
channel?: (string|null);
/** BaseMsg payload */
payload?: (Uint8Array|null);
}
/** Represents a BaseMsg. */
class BaseMsg implements IBaseMsg {
/**
* Constructs a new BaseMsg.
* @param [properties] Properties to set
*/
constructor(properties?: deno.IBaseMsg);
/** BaseMsg channel. */
public channel: string;
/** BaseMsg payload. */
public payload: Uint8Array;
/**
* Creates a new BaseMsg instance using the specified properties.
* @param [properties] Properties to set
* @returns BaseMsg instance
*/
public static create(properties?: deno.IBaseMsg): deno.BaseMsg;
/**
* Encodes the specified BaseMsg message. Does not implicitly {@link deno.BaseMsg.verify|verify} messages.
* @param message BaseMsg message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: deno.IBaseMsg, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Encodes the specified BaseMsg message, length delimited. Does not implicitly {@link deno.BaseMsg.verify|verify} messages.
* @param message BaseMsg message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: deno.IBaseMsg, writer?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a BaseMsg message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns BaseMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): deno.BaseMsg;
/**
* Decodes a BaseMsg message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns BaseMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): deno.BaseMsg;
/**
* Verifies a BaseMsg message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);
/**
* Creates a BaseMsg message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns BaseMsg
*/
public static fromObject(object: { [k: string]: any }): deno.BaseMsg;
/**
* Creates a plain object from a BaseMsg message. Also converts values to other types if specified.
* @param message BaseMsg
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: deno.BaseMsg, options?: $protobuf.IConversionOptions): { [k: string]: any };
/**
* Converts this BaseMsg to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
/** Properties of a Msg. */
interface IMsg {

View file

@ -25,219 +25,6 @@
*/
var deno = {};
deno.BaseMsg = (function() {
/**
* Properties of a BaseMsg.
* @memberof deno
* @interface IBaseMsg
* @property {string|null} [channel] BaseMsg channel
* @property {Uint8Array|null} [payload] BaseMsg payload
*/
/**
* Constructs a new BaseMsg.
* @memberof deno
* @classdesc Represents a BaseMsg.
* @implements IBaseMsg
* @constructor
* @param {deno.IBaseMsg=} [properties] Properties to set
*/
function BaseMsg(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* BaseMsg channel.
* @member {string} channel
* @memberof deno.BaseMsg
* @instance
*/
BaseMsg.prototype.channel = "";
/**
* BaseMsg payload.
* @member {Uint8Array} payload
* @memberof deno.BaseMsg
* @instance
*/
BaseMsg.prototype.payload = $util.newBuffer([]);
/**
* Creates a new BaseMsg instance using the specified properties.
* @function create
* @memberof deno.BaseMsg
* @static
* @param {deno.IBaseMsg=} [properties] Properties to set
* @returns {deno.BaseMsg} BaseMsg instance
*/
BaseMsg.create = function create(properties) {
return new BaseMsg(properties);
};
/**
* Encodes the specified BaseMsg message. Does not implicitly {@link deno.BaseMsg.verify|verify} messages.
* @function encode
* @memberof deno.BaseMsg
* @static
* @param {deno.IBaseMsg} message BaseMsg message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
BaseMsg.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.channel != null && message.hasOwnProperty("channel"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel);
if (message.payload != null && message.hasOwnProperty("payload"))
writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payload);
return writer;
};
/**
* Encodes the specified BaseMsg message, length delimited. Does not implicitly {@link deno.BaseMsg.verify|verify} messages.
* @function encodeDelimited
* @memberof deno.BaseMsg
* @static
* @param {deno.IBaseMsg} message BaseMsg message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
BaseMsg.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a BaseMsg message from the specified reader or buffer.
* @function decode
* @memberof deno.BaseMsg
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {deno.BaseMsg} BaseMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
BaseMsg.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.deno.BaseMsg();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.channel = reader.string();
break;
case 2:
message.payload = reader.bytes();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a BaseMsg message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof deno.BaseMsg
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {deno.BaseMsg} BaseMsg
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
BaseMsg.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a BaseMsg message.
* @function verify
* @memberof deno.BaseMsg
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
BaseMsg.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.channel != null && message.hasOwnProperty("channel"))
if (!$util.isString(message.channel))
return "channel: string expected";
if (message.payload != null && message.hasOwnProperty("payload"))
if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
return "payload: buffer expected";
return null;
};
/**
* Creates a BaseMsg message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof deno.BaseMsg
* @static
* @param {Object.<string,*>} object Plain object
* @returns {deno.BaseMsg} BaseMsg
*/
BaseMsg.fromObject = function fromObject(object) {
if (object instanceof $root.deno.BaseMsg)
return object;
var message = new $root.deno.BaseMsg();
if (object.channel != null)
message.channel = String(object.channel);
if (object.payload != null)
if (typeof object.payload === "string")
$util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
else if (object.payload.length)
message.payload = object.payload;
return message;
};
/**
* Creates a plain object from a BaseMsg message. Also converts values to other types if specified.
* @function toObject
* @memberof deno.BaseMsg
* @static
* @param {deno.BaseMsg} message BaseMsg
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
BaseMsg.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.channel = "";
object.payload = options.bytes === String ? "" : [];
}
if (message.channel != null && message.hasOwnProperty("channel"))
object.channel = message.channel;
if (message.payload != null && message.hasOwnProperty("payload"))
object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;
return object;
};
/**
* Converts this BaseMsg to JSON.
* @function toJSON
* @memberof deno.BaseMsg
* @instance
* @returns {Object.<string,*>} JSON object
*/
BaseMsg.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
return BaseMsg;
})();
deno.Msg = (function() {
/**

View file

@ -2,12 +2,6 @@
// All rights reserved. MIT License.
syntax = "proto3";
package deno;
option go_package = "deno";
message BaseMsg {
string channel = 1;
bytes payload = 2;
}
message Msg {
enum Command {