Interface IConfigApi
Manages the IPFS Configuration.
Namespace: Ipfs.CoreApi
Assembly: Ipfs.Core.dll
Syntax
public interface IConfigApi
Remarks
Configuration values are JSON. Json.NET is used to represent JSON.
Methods
| Improve this Doc View SourceGetAsync(String, CancellationToken)
Gets the value of a configuration key.
Declaration
Task<JToken> GetAsync(string key, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | key | The key name, such as "Addresses.API". |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task<Newtonsoft.Json.Linq.JToken> | The value of the |
Remarks
Keys are case sensistive.
Exceptions
Type | Condition |
---|---|
Exception | When the |
GetAsync(CancellationToken)
Gets the entire configuration.
Declaration
Task<JObject> GetAsync(CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<Newtonsoft.Json.Linq.JObject> | A Newtonsoft.Json.Linq.JObject containing the configuration. |
ReplaceAsync(JObject)
Replaces the entire configuration.
Declaration
Task ReplaceAsync(JObject config)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.Linq.JObject | config |
Returns
Type | Description |
---|---|
Task |
SetAsync(String, JToken, CancellationToken)
Adds or replaces a configuration value.
Declaration
Task SetAsync(string key, JToken value, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | key | The key name, such as "Addresses.API". |
Newtonsoft.Json.Linq.JToken | value | The new Newtonsoft.Json.Linq.JToken value of the |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task |
SetAsync(String, String, CancellationToken)
Adds or replaces a configuration value.
Declaration
Task SetAsync(string key, string value, CancellationToken cancel = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | key | The key name, such as "Addresses.API". |
String | value | The new String value of the |
CancellationToken | cancel | Is used to stop the task. When cancelled, the TaskCanceledException is raised. |
Returns
Type | Description |
---|---|
Task |