-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement IBlockRepository #40
- Loading branch information
1 parent
4b4eceb
commit ae56cf6
Showing
6 changed files
with
97 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Ipfs.CoreApi | ||
{ | ||
/// <summary> | ||
/// Manages all the blocks stored locally. | ||
/// </summary> | ||
/// <seealso cref="IBlockApi"/> | ||
public interface IBlockRepositoryApi | ||
{ | ||
/// <summary> | ||
/// Perform a garbage collection sweep on the repo. | ||
/// </summary> | ||
/// <param name="cancel"> | ||
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised. | ||
/// </param> | ||
/// <returns> | ||
/// TODO: not sure what this should return. | ||
/// </returns> | ||
Task RemoveGarage(CancellationToken cancel = default(CancellationToken)); | ||
|
||
/// <summary> | ||
/// Get statistics on the repository. | ||
/// </summary> | ||
/// <param name="cancel"> | ||
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised. | ||
/// </param> | ||
/// <returns> | ||
/// A task that represents the asynchronous operation. The task's result is | ||
/// the current <see cref="RepositoryData"/>. | ||
/// </returns> | ||
/// <remarks> | ||
/// Same as <see cref="IStatsApi.RepositoryAsync(CancellationToken)"/>. | ||
/// </remarks> | ||
Task<RepositoryData> Statistics(CancellationToken cancel = default(CancellationToken)); | ||
|
||
/// <summary> | ||
/// Verify all blocks in repo are not corrupted. | ||
/// </summary> | ||
/// <param name="cancel"> | ||
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised. | ||
/// </param> | ||
/// <returns> | ||
/// TODO: not sure what this should return. | ||
/// </returns> | ||
Task Verify(CancellationToken cancel = default(CancellationToken)); | ||
|
||
/// <summary> | ||
/// Gets the version number of the repo. | ||
/// </summary> | ||
/// <param name="cancel"> | ||
/// Is used to stop the task. When cancelled, the <see cref="TaskCanceledException"/> is raised. | ||
/// </param> | ||
/// <returns> | ||
/// A task that represents the asynchronous operation. The task's result is | ||
/// the version number of the data block repository. | ||
/// </returns> | ||
Task<string> Version(CancellationToken cancel = default(CancellationToken)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters