Files
gitops/ts/classes/gitopsapp.ts
2026-02-24 12:29:58 +00:00

35 lines
901 B
TypeScript

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');
}
}