Simplify API
This commit is contained in:
parent
d766aacecc
commit
1f58525816
@ -3,6 +3,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// An author setup to indicate who create a depot or identify a depot author when uploading it.
|
/// An author setup to indicate who create a depot or identify a depot author when uploading it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Serializable]
|
||||||
public readonly struct Author : IEquatable<Author>
|
public readonly struct Author : IEquatable<Author>
|
||||||
{
|
{
|
||||||
public readonly string Name;
|
public readonly string Name;
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
namespace Flawless.Abstraction;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Standardized interface for depot to represent a depot inner data handles.
|
|
||||||
/// </summary>
|
|
||||||
public interface IDepotConnection : IDisposable
|
|
||||||
|
|
||||||
{
|
|
||||||
public IReadonlyRepository Repository { get; }
|
|
||||||
|
|
||||||
public IDepotLabel Label { get; }
|
|
||||||
|
|
||||||
public IDepotStorage Storage { get; }
|
|
||||||
}
|
|
||||||
@ -7,5 +7,5 @@ public interface IDepotLabel
|
|||||||
{
|
{
|
||||||
public abstract HashId Id { get; }
|
public abstract HashId Id { get; }
|
||||||
|
|
||||||
public IEnumerable<HashId> Dependencies { get; }
|
public abstract IEnumerable<HashId> Dependencies { get; }
|
||||||
}
|
}
|
||||||
@ -1,9 +0,0 @@
|
|||||||
namespace Flawless.Abstraction;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Standardized interface to translate a depot to binary stream which also provides a stream lifetime management.
|
|
||||||
/// </summary>
|
|
||||||
public interface IDepotStorage
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
namespace Flawless.Abstraction;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Standard interface for repository to store file/directory lock info in this repository.
|
|
||||||
/// </summary>
|
|
||||||
public interface IOccupationChart
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -7,16 +7,10 @@ public interface IReadonlyRepository
|
|||||||
{
|
{
|
||||||
public bool IsReadonly { get; }
|
public bool IsReadonly { get; }
|
||||||
|
|
||||||
|
|
||||||
public uint GetLatestCommitId();
|
|
||||||
|
|
||||||
public IEnumerable<RepositoryCommit> GetCommits();
|
public IEnumerable<RepositoryCommit> GetCommits();
|
||||||
|
|
||||||
public RepositoryCommit? GetCommitById(uint commitId);
|
public RepositoryCommit? GetCommitById(uint commitId);
|
||||||
|
|
||||||
|
|
||||||
public Task<uint> GetLatestCommitIdAsync(CancellationToken cancellationToken = default);
|
|
||||||
|
|
||||||
public IAsyncEnumerable<RepositoryCommit> GetCommitsAsync(CancellationToken cancellationToken = default);
|
public IAsyncEnumerable<RepositoryCommit> GetCommitsAsync(CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
public Task<RepositoryCommit?> GetCommitByIdAsync(uint commitId, CancellationToken cancellationToken = default);
|
public Task<RepositoryCommit?> GetCommitByIdAsync(uint commitId, CancellationToken cancellationToken = default);
|
||||||
|
|||||||
@ -5,21 +5,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IRepository : IReadonlyRepository
|
public interface IRepository : IReadonlyRepository
|
||||||
{
|
{
|
||||||
public IWorkspace Workspace { get; }
|
|
||||||
|
|
||||||
public IOccupationChart OccupationChart { get; }
|
|
||||||
|
|
||||||
|
|
||||||
public uint GetActiveCommitId();
|
public uint GetActiveCommitId();
|
||||||
|
|
||||||
public RepositoryCommit SubmitWorkspace();
|
|
||||||
|
|
||||||
public void SyncOccupationChart();
|
|
||||||
|
|
||||||
|
|
||||||
public Task GetActiveCommitIdAsync(CancellationToken cancellationToken = default);
|
public Task GetActiveCommitIdAsync(CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
public Task<RepositoryCommit> SubmitWorkspaceAsync(CancellationToken cancellationToken = default);
|
|
||||||
|
|
||||||
public Task SyncOccupationChartAsync(CancellationToken cancellationToken = default);
|
|
||||||
}
|
}
|
||||||
@ -1,9 +0,0 @@
|
|||||||
namespace Flawless.Abstraction;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Standardized interface for repository working area (Which means those changes are not committed yet.
|
|
||||||
/// </summary>
|
|
||||||
public interface IWorkspace
|
|
||||||
{
|
|
||||||
public string Message { get; set; }
|
|
||||||
}
|
|
||||||
@ -13,4 +13,9 @@ public abstract class RepositoryCommit
|
|||||||
public abstract string Message { get; }
|
public abstract string Message { get; }
|
||||||
|
|
||||||
public abstract IDepotLabel Depot { get; }
|
public abstract IDepotLabel Depot { get; }
|
||||||
|
|
||||||
|
public abstract RepositoryCommit? GetParentCommit();
|
||||||
|
|
||||||
|
public abstract RepositoryCommit? GetChildCommit();
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user