Class DevDfs
A very naive implementation of the IDfs interface that simply relies on the file system. This can only result in a 'Distributed' file system if the Catalyst.Core.Modules.Dfs.DevDfs._baseFolder happens to be shared network path. Otherwise, this can be used in integration tests, to ensure the tests can be run locally and offline.
Inheritance
System.Object
DevDfs
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Catalyst.Core.Modules.Dfs
Assembly: Catalyst.Core.Modules.Dfs.dll
Syntax
public class DevDfs : IDfs
Remarks
The hashing algorithm is also a simple one (
Constructors
| Improve this Doc View SourceDevDfs(IFileSystem, IHashProvider, String)
Declaration
public DevDfs(IFileSystem fileSystem, IHashProvider hashProvider, string baseFolder = null)
Parameters
Type | Name | Description |
---|---|---|
IFileSystem | fileSystem | |
IHashProvider | hashProvider | |
System.String | baseFolder |
Methods
| Improve this Doc View SourceAddAsync(Stream, String, CancellationToken)
Declaration
public Task<Cid> AddAsync(Stream content, string name = "", CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | content | |
System.String | name | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Cid> |
AddTextAsync(String, CancellationToken)
Declaration
public Task<Cid> AddTextAsync(string utf8Content, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.String | utf8Content | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Cid> |
ReadAsync(Cid, CancellationToken)
Declaration
public Task<Stream> ReadAsync(Cid cid, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Cid | cid | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.IO.Stream> |
ReadTextAsync(Cid, CancellationToken)
Declaration
public Task<string> ReadTextAsync(Cid cid, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Cid | cid | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |