"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const MsNodeType_1 = require("../enums/MsNodeType");
const RouteType_1 = require("../enums/RouteType");
/**
 * 缩减版的 SideCar
 */
class SideCar {
    buildHostUrl(serviceClientConfig, sid, version, requestObj) {
        requestObj.fromNode = MsNodeType_1.MsNodeType.CLIENT_JS;
        requestObj.toNode = MsNodeType_1.MsNodeType.GATEWAY;
        if (serviceClientConfig.routeType == RouteType_1.RouteType.GATE_WAY) { //A.走网关
            return serviceClientConfig.hostAddress;
        }
        else {
            throw Error(`Unknown RouteType [ ${serviceClientConfig.routeType} ]`);
        }
    }
}
exports.default = new SideCar();
//# sourceMappingURL=SideCar.js.map