Files
deepdrft/DeepDrftContent.Data/FileDatabase/Abstractions/IIndexFactory.cs
T
Daniel Harvey cd700dc758 feat(data): rename *.Services projects, lift TrackEntity onto BlazorBlocks data layer, regenerate initial Postgres migration
DeepDrftWeb.Services → DeepDrftData; DeepDrftContent.Services → DeepDrftContent.Data.
TrackEntity:BaseEntity, TrackRepository:Repository<>, TrackManager:Manager<>+ITrackService.
Drops DeepDrftModels PagingParameters/PagedResult in favour of Models.Common.* from BlazorBlocks.
InitialCreate migration captures full schema including is_deleted index.
2026-05-18 22:22:09 -04:00

52 lines
1.6 KiB
C#

using DeepDrftContent.Data.FileDatabase.Models;
using IndexType = DeepDrftContent.Data.FileDatabase.Services.IndexType;
namespace DeepDrftContent.Data.FileDatabase.Abstractions;
/// <summary>
/// Interface for creating index instances
/// </summary>
public interface IIndexFactory
{
/// <summary>
/// Loads an existing index of the specified type
/// </summary>
Task<IIndex?> LoadIndexAsync(IndexType type, string rootPath);
/// <summary>
/// Creates a directory index
/// </summary>
Task<IDirectoryIndex?> CreateDirectoryIndexAsync(string rootPath);
/// <summary>
/// Loads existing directory index or creates new one if loading fails
/// </summary>
Task<IDirectoryIndex?> LoadOrCreateDirectoryIndexAsync(string rootPath);
/// <summary>
/// Creates a vault index with the specified vault type
/// </summary>
Task<IVaultIndex?> CreateVaultIndexAsync(string rootPath, MediaVaultType vaultType);
/// <summary>
/// Loads existing vault index or creates new one with the specified vault type if loading fails
/// </summary>
Task<IVaultIndex?> LoadOrCreateVaultIndexAsync(string rootPath, MediaVaultType vaultType);
}
/// <summary>
/// Interface for creating index data objects
/// </summary>
public interface IIndexDataFactory
{
/// <summary>
/// Creates index data for serialization
/// </summary>
object CreateIndexData(IndexType type, IIndex index);
/// <summary>
/// Creates index instance from data
/// </summary>
IIndex CreateIndexFromData(IndexType type, object indexData);
}