Interface IValueStore
A basic Put/Get interface.
Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IValueStore
Methods
| Improve this Doc View SourceGetAsync(Byte[], CancellationToken)
Gets th value of a key.
Declaration
Task<byte[]> GetAsync(byte[] key, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Byte[] | key | A byte array representing the name of a key. |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<Byte[]> | A task that represents the asynchronous operation that returns the value of the key as a byte array. |
PutAsync(Byte[], out Byte[], CancellationToken)
Put the value of a key.
Declaration
Task PutAsync(byte[] key, out byte[] value, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Byte[] | key | A byte array representing the name of a key. |
Byte[] | value | A byte array containing the value of the |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
TryGetAsync(Byte[], out Byte[], CancellationToken)
Tries to get the value of a key.
Declaration
Task<bool> TryGetAsync(byte[] key, out byte[] value, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Byte[] | key | A byte array representing the name of a key. |
Byte[] | value | A byte array containing the value of the |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<Boolean> | A task that represents the asynchronous operation that returns true if the key exists; otherwise, false. |