UNPKG

nats-memory-server

Version:
45 lines 1.46 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NatsServerBuilder = void 0; const index_1 = require("./index"); class NatsServerBuilder { constructor(options) { this.options = index_1.DEFAULT_NATS_SERVER_OPTIONS; if (options != null) { this.options = Object.assign(Object.assign({}, this.options), options); } } static create(options) { return new NatsServerBuilder(options); } setBinPath(binPath) { this.options = Object.assign(Object.assign({}, this.options), { binPath }); return this; } setVerbose(verbose) { this.options = Object.assign(Object.assign({}, this.options), { verbose }); return this; } setPort(port) { this.options = Object.assign(Object.assign({}, this.options), { port }); return this; } setIp(ip) { this.options = Object.assign(Object.assign({}, this.options), { ip }); return this; } setArgs(args) { this.options = Object.assign(Object.assign({}, this.options), { args }); return this; } setLogger(logger) { this.options = Object.assign(Object.assign({}, this.options), { logger }); return this; } build() { const server = new index_1.NatsServer(this.options); return server; } } exports.NatsServerBuilder = NatsServerBuilder; //# sourceMappingURL=nats-server.builder.js.map