UNPKG

@remnawave/xtls-sdk

Version:

A Typescript SDK for XRAY (XTLS) Core GRPC Api

69 lines (68 loc) 2.31 kB
"use strict"; // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.2.7 // protoc v5.28.3 // source: proxy/loopback/config.proto Object.defineProperty(exports, "__esModule", { value: true }); exports.Config = exports.protobufPackage = void 0; /* eslint-disable */ const wire_1 = require("@bufbuild/protobuf/wire"); const typeRegistry_1 = require("../../typeRegistry"); exports.protobufPackage = "xray.proxy.loopback"; function createBaseConfig() { return { $type: "xray.proxy.loopback.Config", inboundTag: "" }; } exports.Config = { $type: "xray.proxy.loopback.Config", encode(message, writer = new wire_1.BinaryWriter()) { if (message.inboundTag !== "") { writer.uint32(10).string(message.inboundTag); } return writer; }, decode(input, length) { const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConfig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.inboundTag = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { $type: exports.Config.$type, inboundTag: isSet(object.inboundTag) ? globalThis.String(object.inboundTag) : "" }; }, toJSON(message) { const obj = {}; if (message.inboundTag !== "") { obj.inboundTag = message.inboundTag; } return obj; }, create(base) { return exports.Config.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseConfig(); message.inboundTag = object.inboundTag ?? ""; return message; }, }; typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config); function isSet(value) { return value !== null && value !== undefined; }