initial
This commit is contained in:
34
ts/classes/gitopsapp.ts
Normal file
34
ts/classes/gitopsapp.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { logger } from '../logging.ts';
|
||||
import { ConnectionManager } from './connectionmanager.ts';
|
||||
import { OpsServer } from '../opsserver/index.ts';
|
||||
|
||||
/**
|
||||
* Main GitOps application orchestrator
|
||||
*/
|
||||
export class GitopsApp {
|
||||
public connectionManager: ConnectionManager;
|
||||
public opsServer: OpsServer;
|
||||
|
||||
constructor() {
|
||||
this.connectionManager = new ConnectionManager();
|
||||
this.opsServer = new OpsServer(this);
|
||||
}
|
||||
|
||||
async start(port = 3000): Promise<void> {
|
||||
logger.info('Initializing GitOps...');
|
||||
|
||||
// Initialize connection manager (loads saved connections)
|
||||
await this.connectionManager.init();
|
||||
|
||||
// Start OpsServer
|
||||
await this.opsServer.start(port);
|
||||
|
||||
logger.success('GitOps initialized successfully');
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
logger.info('Shutting down GitOps...');
|
||||
await this.opsServer.stop();
|
||||
logger.success('GitOps shutdown complete');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user