Improved comments. Started implementing docker components and other base components. Updated dependencies

This commit is contained in:
2025-09-06 21:44:22 +02:00
parent 348e9560ab
commit 282096595d
16 changed files with 672 additions and 52 deletions

View File

@@ -0,0 +1,58 @@
using MoonlightServers.Daemon.ServerSystem.Interfaces;
using MoonlightServers.Daemon.ServerSystem.Models;
namespace MoonlightServers.Daemon.ServerSystem.FileSystems;
public class RawRuntimeFs : IFileSystem
{
private readonly string BaseDirectory;
public RawRuntimeFs(ServerContext context)
{
BaseDirectory = Path.Combine(
Directory.GetCurrentDirectory(),
"storage",
"volumes",
context.Configuration.Id.ToString()
);
}
public Task InitializeAsync()
=> Task.CompletedTask;
public Task<string> GetPathAsync()
=> Task.FromResult(BaseDirectory);
public Task<bool> CheckExistsAsync()
{
var exists = Directory.Exists(BaseDirectory);
return Task.FromResult(exists);
}
public Task<bool> CheckMountedAsync()
=> Task.FromResult(true);
public Task CreateAsync()
{
Directory.CreateDirectory(BaseDirectory);
return Task.CompletedTask;
}
public Task PerformChecksAsync()
=> Task.CompletedTask;
public Task MountAsync()
=> Task.CompletedTask;
public Task UnmountAsync()
=> Task.CompletedTask;
public Task DestroyAsync()
{
Directory.Delete(BaseDirectory, true);
return Task.CompletedTask;
}
public ValueTask DisposeAsync()
=> ValueTask.CompletedTask;
}