using MoonlightServers.DaemonShared.PanelSide.Http.Responses; 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 /// /// Host path of the runtime storage location /// Host path of the installation file system /// Installation data for the server /// public Task CreateAsync(string runtimePath, string hostPath, ServerInstallDataResponse data); /// /// 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 /// /// Callback to invoke whenever the installation exists /// Subscription disposable to unsubscribe from the event public Task SubscribeExitedAsync(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(); }