namespace MoonlightServers.Daemon.ServerSystem.Interfaces;
public interface IInstallation : IServerComponent
{
///
/// Checks if the installation environment exists. It doesn't matter if it is currently running or not
///
/// True if it exists, False if it doesn't
public Task CheckExistsAsync();
///
/// Creates the installation environment
///
/// The host path of the runtime storage location
/// The host path of the installation file system
///
public Task CreateAsync(string runtimePath, string hostPath);
///
/// Starts the installation
///
///
public Task StartAsync();
///
/// Kills the current installation immediately
///
///
public Task KillAsync();
///
/// Removes the installation. E.g. removes the docker container
///
///
public Task DestroyAsync();
///
/// Subscribes to the event when the installation exists
///
/// The callback to invoke whenever the installation exists
/// Subscription disposable to unsubscribe from the event
public Task SubscribeExited(Func callback);
///
/// Connects an existing installation to this abstraction in order to restore it.
/// E.g. fetching the container id and using it for exit events
///
///
public Task RestoreAsync();
}