pot-js
Version:
Process management module
109 lines (90 loc) • 2.79 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.flushAll = exports.flush = exports.show = exports.log = exports.list = exports.scale = exports.stopAll = exports.stop = exports.reloadAll = exports.reload = exports.restartAll = exports.restart = exports.start = undefined;
var _cli = require('./Schemas/cli');
var Schemas = _interopRequireWildcard(_cli);
var _Operators = require('./Operators');
var Operators = _interopRequireWildcard(_Operators);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
const start = exports.start = {
command: 'start [entry]',
description: 'Spawn and monitor a process',
schema: Schemas.start,
operator: Operators.start,
configFile: 'config'
};
const restart = exports.restart = {
command: 'restart [name]',
description: 'Restart a process',
schema: Schemas.restart,
operator: Operators.restart
};
const restartAll = exports.restartAll = {
command: 'restartall',
description: 'Restart all processes',
schema: Schemas.restartAll,
operator: Operators.restartAll
};
const reload = exports.reload = {
command: 'reload [name]',
description: 'Reload a process',
schema: Schemas.reload,
operator: Operators.reload
};
const reloadAll = exports.reloadAll = {
command: 'reloadall',
description: 'Reload all processes',
schema: Schemas.reloadAll,
operator: Operators.reloadAll
};
const stop = exports.stop = {
command: 'stop [name]',
description: 'Stop a process',
schema: Schemas.stop,
operator: Operators.stop
};
const stopAll = exports.stopAll = {
command: 'stopall',
description: 'Stop all processes',
schema: Schemas.stopAll,
operator: Operators.stopAll
};
const scale = exports.scale = {
command: 'scale [name] [instances]',
description: 'Scale up/down a process',
schema: Schemas.scale,
operator: Operators.scale
};
const list = exports.list = {
command: 'list',
aliases: ['ls'],
description: 'List processes',
schema: Schemas.list,
operator: Operators.list
};
const log = exports.log = {
command: 'log [name] [category]',
description: 'Show log',
schema: Schemas.log,
operator: Operators.log
};
const show = exports.show = {
command: 'show [name]',
description: 'Show process information',
schema: Schemas.show,
operator: Operators.show
};
const flush = exports.flush = {
command: 'flush [name]',
description: 'Remove log files',
schema: Schemas.flush,
operator: Operators.flush
};
const flushAll = exports.flushAll = {
command: 'flushall',
description: 'Remove all log files',
schema: Schemas.flushAll,
operator: Operators.flushAll
};