Recreated plugin with new project template. Started implementing server system daemon
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IInstallConsole
|
||||
{
|
||||
public event Func<string, Task>? OnOutput;
|
||||
|
||||
public Task AttachAsync();
|
||||
|
||||
public Task WriteInputAsync(string value);
|
||||
|
||||
public Task ClearCacheAsync();
|
||||
public Task<string[]> GetCacheAsync();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IInstallEnvironment : IAsyncDisposable
|
||||
{
|
||||
public IInstallStatistics Statistics { get; }
|
||||
public IInstallConsole Console { get; }
|
||||
|
||||
public event Func<Task>? OnExited;
|
||||
|
||||
public Task<bool> IsRunningAsync();
|
||||
|
||||
public Task StartAsync();
|
||||
public Task KillAsync();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using MoonlightServers.Daemon.Models;
|
||||
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IInstallEnvironmentService
|
||||
{
|
||||
public Task<IInstallEnvironment?> FindAsync(string id);
|
||||
|
||||
public Task<IInstallEnvironment> CreateAsync(
|
||||
string id,
|
||||
RuntimeConfiguration runtimeConfiguration,
|
||||
InstallConfiguration installConfiguration,
|
||||
IInstallStorage installStorage,
|
||||
IRuntimeStorage runtimeStorage
|
||||
);
|
||||
|
||||
public Task DeleteAsync(IInstallEnvironment environment);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IInstallStatistics
|
||||
{
|
||||
public event Func<ServerStatistics, Task>? OnStatisticsReceived;
|
||||
|
||||
public Task AttachAsync();
|
||||
|
||||
public Task ClearCacheAsync();
|
||||
public Task<ServerStatistics[]> GetCacheAsync();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IInstallStorage
|
||||
{
|
||||
public Task<string> GetHostPathAsync();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using MoonlightServers.Daemon.Models;
|
||||
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IInstallStorageService
|
||||
{
|
||||
public Task<IInstallStorage?> FindAsync(string id);
|
||||
public Task<IInstallStorage> CreateAsync(string id, RuntimeConfiguration runtimeConfiguration, InstallConfiguration installConfiguration);
|
||||
public Task DeleteAsync(IInstallStorage installStorage);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IRuntimeConsole
|
||||
{
|
||||
public event Func<string, Task>? OnOutput;
|
||||
|
||||
public Task AttachAsync();
|
||||
|
||||
public Task WriteInputAsync(string value);
|
||||
|
||||
public Task ClearCacheAsync();
|
||||
public Task<string[]> GetCacheAsync();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IRuntimeEnvironment : IAsyncDisposable
|
||||
{
|
||||
public IRuntimeStatistics Statistics { get; }
|
||||
public IRuntimeConsole Console { get; }
|
||||
|
||||
public event Func<Task>? OnExited;
|
||||
|
||||
public Task<bool> IsRunningAsync();
|
||||
|
||||
public Task StartAsync();
|
||||
public Task KillAsync();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using MoonlightServers.Daemon.Models;
|
||||
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IRuntimeEnvironmentService
|
||||
{
|
||||
public Task<IRuntimeEnvironment?> FindAsync(string id);
|
||||
public Task<IRuntimeEnvironment> CreateAsync(string id, RuntimeConfiguration configuration, IRuntimeStorage runtimeStorage);
|
||||
public Task UpdateAsync(IRuntimeEnvironment environment, RuntimeConfiguration configuration);
|
||||
public Task DeleteAsync(IRuntimeEnvironment environment);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IRuntimeStatistics
|
||||
{
|
||||
public event Func<ServerStatistics, Task>? OnStatisticsReceived;
|
||||
|
||||
public Task AttachAsync();
|
||||
|
||||
public Task ClearCacheAsync();
|
||||
public Task<ServerStatistics[]> GetCacheAsync();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IRuntimeStorage
|
||||
{
|
||||
public Task<string> GetHostPathAsync();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using MoonlightServers.Daemon.Models;
|
||||
|
||||
namespace MoonlightServers.Daemon.ServerSystem.Abstractions;
|
||||
|
||||
public interface IRuntimeStorageService
|
||||
{
|
||||
public Task<IRuntimeStorage?> FindAsync(string id);
|
||||
public Task<IRuntimeStorage> CreateAsync(string id, RuntimeConfiguration configuration);
|
||||
public Task UpdateAsync(IRuntimeStorage runtimeStorage, RuntimeConfiguration configuration);
|
||||
public Task DeleteAsync(IRuntimeStorage runtimeStorage);
|
||||
}
|
||||
Reference in New Issue
Block a user