diff options
author | SionoiS <SionoiS@users.noreply.github.com> | 2020-08-04 11:06:23 -0400 |
---|---|---|
committer | SionoiS <SionoiS@users.noreply.github.com> | 2020-08-04 11:06:23 -0400 |
commit | 6af9cfd1664edf4ad78277d4079700ec53f2206e (patch) | |
tree | 0a1b955dd690b83c883f3f42476774b003ddade2 /ipfs-api/src/client | |
parent | 8c999d104f403b34d9d9b8a63d1ed41c4aa871ee (diff) |
Config API
Diffstat (limited to 'ipfs-api/src/client')
-rw-r--r-- | ipfs-api/src/client/internal.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ipfs-api/src/client/internal.rs b/ipfs-api/src/client/internal.rs index 17059fd..60acf2e 100644 --- a/ipfs-api/src/client/internal.rs +++ b/ipfs-api/src/client/internal.rs @@ -789,6 +789,35 @@ impl IpfsClient { self.request(request::Commands, None).await } + /// Get and set ipfs config values. + /// + /// ```no_run + /// use ipfs_api::IpfsClient; + /// + /// let client = IpfsClient::default(); + /// let res = client.config("Identity.PeerID", None, None, None); + /// ``` + /// + #[inline] + pub async fn config( + &self, + key: &str, + value: Option<&str>, + boolean: Option<bool>, + stringified_json: Option<bool>, + ) -> Result<response::ConfigResponse, Error> { + self.request( + request::Config { + key, + value, + boolean, + stringified_json, + }, + None, + ) + .await + } + /// Opens the config file for editing (on the server). /// /// ```no_run |