diff --git a/src/CoreApi/AddFileOptions.cs b/src/CoreApi/AddFileOptions.cs index 4ed0de27..e4103e17 100644 --- a/src/CoreApi/AddFileOptions.cs +++ b/src/CoreApi/AddFileOptions.cs @@ -96,5 +96,15 @@ public class AddFileOptions /// Used to report the progress of a file transfer. /// public IProgress? Progress { get; set; } + + /// + /// Add the file using filestore. Implies raw-leaves. + /// + public bool? NoCopy {get; set; } + + /// + /// Check the filestore for pre-existing blocks. + /// + public bool? FsCache{get; set; } } } diff --git a/src/CoreApi/IFilestoreApi.cs b/src/CoreApi/IFilestoreApi.cs new file mode 100644 index 00000000..7a08e209 --- /dev/null +++ b/src/CoreApi/IFilestoreApi.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace Ipfs.CoreApi +{ + /// + /// Abstraction for the file store api. + /// + public interface IFilestoreApi + { + /// + /// Lists blocks that are both in the filestore and standard block storage. + /// + public Task DupsAsync(CancellationToken token); + + /// + /// Lists filestore objects + /// + /// Cid of objects to verify. Required: no. + /// The cancellation token. + /// Verify the objects based on the order of the backing file. Required: no. + /// + public Task ListAsync(string cid, bool fileOrder, CancellationToken token); + + /// + /// + /// + /// Cid of objects to list. Required: no. + /// The cancellation token. + /// Lists the objects based on the order of the backing file. Required: no. + /// + public Task VerifyObjectsAsync(string cid, bool fileOrder, CancellationToken token); + } +} diff --git a/src/CoreApi/IFilestoreApiObjectResponse.cs b/src/CoreApi/IFilestoreApiObjectResponse.cs new file mode 100644 index 00000000..17e8cf78 --- /dev/null +++ b/src/CoreApi/IFilestoreApiObjectResponse.cs @@ -0,0 +1,63 @@ +using Newtonsoft.Json; + +namespace Ipfs.CoreApi +{ + /// + /// Interface for repsonse. + /// + public interface IFilestoreApiObjectResponse + { + /// + /// Holds any error message. + /// + public string ErrorMsg { get; set; } + + /// + /// Path to the file + /// + public string FilePath { get; set; } + + /// + /// The response offset. + /// + public string Offset { get; set; } + + /// + /// The size of the object. + /// + public string Size { get; set; } + + /// + /// The object status. + /// + public string Status { get; set; } + } + + /// + /// Model for the hold filestore key + /// + public interface IFilestoreKey + { + /// + /// Key value. + /// + [JsonProperty("/")] + public string _ { get; set; } + } + + /// + /// Interface for response. + /// + public interface IDupsResponse + { + /// + /// Any error in the Dups response. + /// + public string Err { get; set; } + + /// + /// The error in the Dups response. + /// + public string Ref { get; set; } + } +}