smartdaemon/ts/smartdaemon.classes.smartdaemon.ts

30 lines
976 B
TypeScript
Raw Normal View History

2019-09-03 09:29:14 +00:00
import * as plugins from './smartdaemon.plugins';
import { SmartDaemonTemplateManager } from './smartdaemon.classes.templatemanager';
2019-09-03 13:21:30 +00:00
import { SmartDaemonService } from './smartdaemon.classes.service';
import { SmartDaemonSystemdManager } from './smartdaemon.classes.systemdmanager';
2019-09-03 09:29:14 +00:00
export class SmartDaemon {
2019-09-03 13:21:30 +00:00
public serviceMap: plugins.lik.Objectmap<SmartDaemonService>;
public templateManager: SmartDaemonTemplateManager;
public systemdManager: SmartDaemonSystemdManager;
2019-09-03 09:29:14 +00:00
constructor() {
2019-09-03 13:21:30 +00:00
this.serviceMap = new plugins.lik.Objectmap<SmartDaemonService>();
this.templateManager = new SmartDaemonTemplateManager(this);
this.systemdManager = new SmartDaemonSystemdManager(this);
2019-09-03 09:29:14 +00:00
}
2019-09-03 13:21:30 +00:00
public async addService(serviceName: string, workingDirectory): Promise<SmartDaemonService> {
const existingService = this.serviceMap.find(serviceArg => {
return serviceArg
})
2019-09-03 09:29:14 +00:00
};
2019-09-03 13:21:30 +00:00
public async init() {
await this.systemdManager.init();
2019-09-03 09:29:14 +00:00
}
2019-09-03 13:21:30 +00:00
}