App
This commit is contained in:
10
src/Alma.Abstraction/Alma.Abstraction.csproj
Normal file
10
src/Alma.Abstraction/Alma.Abstraction.csproj
Normal file
@@ -0,0 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>Alma</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
7
src/Alma.Abstraction/Command/ICommand.cs
Normal file
7
src/Alma.Abstraction/Command/ICommand.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Alma.Command;
|
||||
|
||||
public interface ICommand
|
||||
{
|
||||
public string CommandString { get; }
|
||||
public Task Run(List<string> parameters);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Alma.Configuration.Module;
|
||||
|
||||
public record ModuleConfiguration(string? Target, Dictionary<string, string>? Links)
|
||||
{
|
||||
public ModuleConfiguration Merge(ModuleConfiguration merge)
|
||||
{
|
||||
var mergedLinks = (Links ?? new Dictionary<string, string>())
|
||||
.Concat(merge.Links ?? new Dictionary<string, string>());
|
||||
return new ModuleConfiguration(
|
||||
merge.Target ?? Target,
|
||||
new Dictionary<string, string>(mergedLinks)
|
||||
);
|
||||
}
|
||||
|
||||
public static ModuleConfiguration Empty() =>
|
||||
new(null, new Dictionary<string, string>());
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Alma.Configuration.Module;
|
||||
|
||||
public class ModuleConfigurationRoot : Dictionary<string, ModuleConfiguration>
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Alma.Configuration.Repository;
|
||||
|
||||
public interface IRepositoryConfiguration
|
||||
{
|
||||
public Task LoadAsync();
|
||||
RepositoryConfigurationRoot Configuration { get; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Alma.Configuration.Repository;
|
||||
|
||||
public record RepositoryConfigurationEntry(
|
||||
string Name,
|
||||
string? RepositoryPath,
|
||||
string? LinkPath
|
||||
);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace Alma.Configuration.Repository;
|
||||
|
||||
public record RepositoryConfigurationRoot(List<RepositoryConfigurationEntry> Repositories);
|
||||
6
src/Alma.Abstraction/Data/Constants.cs
Normal file
6
src/Alma.Abstraction/Data/Constants.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Alma.Data;
|
||||
|
||||
public static class Constants
|
||||
{
|
||||
public static readonly string ModuleConfigFileStub = ".alma-config";
|
||||
}
|
||||
3
src/Alma.Abstraction/Data/ItemToLink.cs
Normal file
3
src/Alma.Abstraction/Data/ItemToLink.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
namespace Alma.Data;
|
||||
|
||||
public record ItemToLink(string SourcePath, string TargetPath);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Alma.Services;
|
||||
|
||||
public interface IConfigurationFileReader
|
||||
{
|
||||
public Task<(T? Result, string? FileName)> DeserializeAsync<T>(string fileNameWithoutExtension, string? extension = null) where T : class;
|
||||
}
|
||||
7
src/Alma.Abstraction/Services/IFolderService.cs
Normal file
7
src/Alma.Abstraction/Services/IFolderService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Alma.Services;
|
||||
|
||||
public interface IFolderService
|
||||
{
|
||||
string? ConfigRoot { get; }
|
||||
string AppData { get; }
|
||||
}
|
||||
8
src/Alma.Abstraction/Services/IMetadataHandler.cs
Normal file
8
src/Alma.Abstraction/Services/IMetadataHandler.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Alma.Data;
|
||||
|
||||
namespace Alma.Services;
|
||||
|
||||
public interface IMetadataHandler
|
||||
{
|
||||
Task SaveLinkedItemsAsync(List<ItemToLink> successfulLinks, DirectoryInfo sourceDirectory, DirectoryInfo targetDirectory);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using Alma.Configuration.Module;
|
||||
|
||||
namespace Alma.Services;
|
||||
|
||||
public interface IModuleConfigurationResolver
|
||||
{
|
||||
Task<(ModuleConfiguration? mergedModuleConfig, string? moduleConfigFileName)> ResolveModuleConfiguration(string moduleConfigStub);
|
||||
}
|
||||
7
src/Alma.Abstraction/Services/IOsInformation.cs
Normal file
7
src/Alma.Abstraction/Services/IOsInformation.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Alma.Services;
|
||||
|
||||
public interface IOsInformation
|
||||
{
|
||||
string GetOsIdentifier();
|
||||
bool IsOnPlatform(string platform);
|
||||
}
|
||||
Reference in New Issue
Block a user