Defined data structures for configuring the initial dats sources

This commit is contained in:
Thorsten Sommer 2025-01-05 16:27:54 +01:00
parent 425c888fd1
commit b5fbbfae51
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
4 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,33 @@
namespace AIStudio.Settings.DataModel;
/// <summary>
/// An external data source, accessed via an ERI server, cf. https://github.com/MindWorkAI/ERI.
/// </summary>
public readonly record struct DataSourceERI : IDataSource
{
public DataSourceERI()
{
}
/// <inheritdoc />
public uint Num { get; init; }
/// <inheritdoc />
public string Id { get; init; } = Guid.Empty.ToString();
/// <inheritdoc />
public string Name { get; init; } = string.Empty;
/// <inheritdoc />
public DataSourceType Type { get; init; } = DataSourceType.NONE;
/// <summary>
/// The hostname of the ERI server.
/// </summary>
public string Hostname { get; init; } = string.Empty;
/// <summary>
/// The port of the ERI server.
/// </summary>
public int Port { get; init; }
}

View File

@ -0,0 +1,28 @@
namespace AIStudio.Settings.DataModel;
/// <summary>
/// Represents a local directory as a data source.
/// </summary>
public readonly record struct DataSourceLocalDirectory : IDataSource
{
public DataSourceLocalDirectory()
{
}
/// <inheritdoc />
public uint Num { get; init; }
/// <inheritdoc />
public string Id { get; init; } = Guid.Empty.ToString();
/// <inheritdoc />
public string Name { get; init; } = string.Empty;
/// <inheritdoc />
public DataSourceType Type { get; init; } = DataSourceType.NONE;
/// <summary>
/// The path to the directory.
/// </summary>
public string Path { get; init; } = string.Empty;
}

View File

@ -0,0 +1,28 @@
namespace AIStudio.Settings.DataModel;
/// <summary>
/// Represents one local file as a data source.
/// </summary>
public readonly record struct DataSourceLocalFile : IDataSource
{
public DataSourceLocalFile()
{
}
/// <inheritdoc />
public uint Num { get; init; }
/// <inheritdoc />
public string Id { get; init; } = Guid.Empty.ToString();
/// <inheritdoc />
public string Name { get; init; } = string.Empty;
/// <inheritdoc />
public DataSourceType Type { get; init; } = DataSourceType.NONE;
/// <summary>
/// The path to the file.
/// </summary>
public string FilePath { get; init; } = string.Empty;
}

View File

@ -0,0 +1,29 @@
using AIStudio.Settings.DataModel;
namespace AIStudio.Settings;
/// <summary>
/// The common interface for all data sources.
/// </summary>
public interface IDataSource
{
/// <summary>
/// The number of the data source.
/// </summary>
public uint Num { get; init; }
/// <summary>
/// The unique identifier of the data source.
/// </summary>
public string Id { get; init; }
/// <summary>
/// The name of the data source.
/// </summary>
public string Name { get; init; }
/// <summary>
/// Which type of data source is this?
/// </summary>
public DataSourceType Type { get; init; }
}