diff options
Diffstat (limited to 'ipfs-api/src/request')
31 files changed, 0 insertions, 1479 deletions
diff --git a/ipfs-api/src/request/add.rs b/ipfs-api/src/request/add.rs deleted file mode 100644 index 889c617..0000000 --- a/ipfs-api/src/request/add.rs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use serde::Serialize; - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -#[serde(rename_all = "kebab-case")] -pub struct Add<'a> { - /// Use trickle-dag format for dag generation. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub trickle: Option<bool>, - - /// Only chunk and hash - do not write to disk. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub only_hash: Option<bool>, - - /// Wrap files with a directory object. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub wrap_with_directory: Option<bool>, - - /// Chunking algorithm, `size-[bytes]`, `rabin-[min]-[avg]-[max]` or `buzhash`. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub chunker: Option<&'a str>, - - /// Pin this object when adding. Defaults to `true`. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub pin: Option<bool>, - - /// Use raw blocks for leaf nodes. (experimental). - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub raw_leaves: Option<bool>, - - /// CID version. Defaults to 0 unless an option that depends on CIDv1 is passed. - /// (experimental). - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub cid_version: Option<u32>, - - /// Hash function to use. Implies CIDv1 if not sha2-256. (experimental). Default: - /// `sha2-256`. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub hash: Option<&'a str>, - - /// Inline small blocks into CIDs. (experimental). - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub inline: Option<bool>, - - /// Maximum block size to inline. (experimental). Default: `32`. - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub inline_limit: Option<u32>, -} - -impl<'a> ApiRequest for Add<'a> { - const PATH: &'static str = "/add"; -} diff --git a/ipfs-api/src/request/bitswap.rs b/ipfs-api/src/request/bitswap.rs deleted file mode 100644 index 1767f2a..0000000 --- a/ipfs-api/src/request/bitswap.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct BitswapLedger<'a> { - #[serde(rename = "arg")] - pub peer: &'a str, -} - -impl<'a> ApiRequest for BitswapLedger<'a> { - const PATH: &'static str = "/bitswap/ledger"; -} - -pub struct BitswapReprovide; - -impl_skip_serialize!(BitswapReprovide); - -impl ApiRequest for BitswapReprovide { - const PATH: &'static str = "/bitswap/reprovide"; -} - -pub struct BitswapStat; - -impl_skip_serialize!(BitswapStat); - -impl ApiRequest for BitswapStat { - const PATH: &'static str = "/bitswap/stat"; -} - -#[derive(Serialize)] -pub struct BitswapUnwant<'a> { - #[serde(rename = "arg")] - pub key: &'a str, -} - -impl<'a> ApiRequest for BitswapUnwant<'a> { - const PATH: &'static str = "/bitswap/stat"; -} - -#[derive(Serialize)] -pub struct BitswapWantlist<'a> { - pub peer: Option<&'a str>, -} - -impl<'a> ApiRequest for BitswapWantlist<'a> { - const PATH: &'static str = "/bitswap/wantlist"; -} diff --git a/ipfs-api/src/request/block.rs b/ipfs-api/src/request/block.rs deleted file mode 100644 index 2f48d73..0000000 --- a/ipfs-api/src/request/block.rs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct BlockGet<'a> { - #[serde(rename = "arg")] - pub hash: &'a str, -} - -impl<'a> ApiRequest for BlockGet<'a> { - const PATH: &'static str = "/block/get"; -} - -pub struct BlockPut; - -impl_skip_serialize!(BlockPut); - -impl ApiRequest for BlockPut { - const PATH: &'static str = "/block/put"; -} - -#[derive(Serialize)] -pub struct BlockRm<'a> { - #[serde(rename = "arg")] - pub hash: &'a str, -} - -impl<'a> ApiRequest for BlockRm<'a> { - const PATH: &'static str = "/block/rm"; -} - -#[derive(Serialize)] -pub struct BlockStat<'a> { - #[serde(rename = "arg")] - pub hash: &'a str, -} - -impl<'a> ApiRequest for BlockStat<'a> { - const PATH: &'static str = "/block/stat"; -} diff --git a/ipfs-api/src/request/bootstrap.rs b/ipfs-api/src/request/bootstrap.rs deleted file mode 100644 index 9e321e5..0000000 --- a/ipfs-api/src/request/bootstrap.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; - -pub struct BootstrapAddDefault; - -impl_skip_serialize!(BootstrapAddDefault); - -impl ApiRequest for BootstrapAddDefault { - const PATH: &'static str = "/bootstrap/add/default"; -} - -pub struct BootstrapList; - -impl_skip_serialize!(BootstrapList); - -impl ApiRequest for BootstrapList { - const PATH: &'static str = "/bootstrap/list"; -} - -pub struct BootstrapRmAll; - -impl_skip_serialize!(BootstrapRmAll); - -impl ApiRequest for BootstrapRmAll { - const PATH: &'static str = "/bootstrap/rm/all"; -} diff --git a/ipfs-api/src/request/cat.rs b/ipfs-api/src/request/cat.rs deleted file mode 100644 index f7e7e06..0000000 --- a/ipfs-api/src/request/cat.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct Cat<'a> { - #[serde(rename = "arg")] - pub path: &'a str, -} - -impl<'a> ApiRequest for Cat<'a> { - const PATH: &'static str = "/cat"; -} diff --git a/ipfs-api/src/request/commands.rs b/ipfs-api/src/request/commands.rs deleted file mode 100644 index 108c45e..0000000 --- a/ipfs-api/src/request/commands.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; - -pub struct Commands; - -impl_skip_serialize!(Commands); - -impl ApiRequest for Commands { - const PATH: &'static str = "/commands"; -} diff --git a/ipfs-api/src/request/config.rs b/ipfs-api/src/request/config.rs deleted file mode 100644 index 9ea5250..0000000 --- a/ipfs-api/src/request/config.rs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct Config<'a> { - #[serde(rename = "arg")] - pub key: &'a str, - - #[serde(rename = "arg")] - pub value: Option<&'a str>, - - #[serde(rename = "bool")] - pub boolean: Option<bool>, - - #[serde(rename = "json")] - pub stringified_json: Option<bool>, -} - -impl<'a> ApiRequest for Config<'a> { - const PATH: &'static str = "/config"; -} - -pub struct ConfigEdit; - -impl_skip_serialize!(ConfigEdit); - -impl ApiRequest for ConfigEdit { - const PATH: &'static str = "/config/edit"; -} - -pub struct ConfigReplace; - -impl_skip_serialize!(ConfigReplace); - -impl ApiRequest for ConfigReplace { - const PATH: &'static str = "/config/replace"; -} - -pub struct ConfigShow; - -impl_skip_serialize!(ConfigShow); - -impl ApiRequest for ConfigShow { - const PATH: &'static str = "/config/show"; -} diff --git a/ipfs-api/src/request/dag.rs b/ipfs-api/src/request/dag.rs deleted file mode 100644 index 075b918..0000000 --- a/ipfs-api/src/request/dag.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct DagGet<'a> { - #[serde(rename = "arg")] - pub path: &'a str, -} - -impl<'a> ApiRequest for DagGet<'a> { - const PATH: &'static str = "/dag/get"; -} - -pub struct DagPut; - -impl_skip_serialize!(DagPut); - -impl ApiRequest for DagPut { - const PATH: &'static str = "/dag/put"; -} diff --git a/ipfs-api/src/request/dht.rs b/ipfs-api/src/request/dht.rs deleted file mode 100644 index 76d7820..0000000 --- a/ipfs-api/src/request/dht.rs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct DhtFindPeer<'a> { - #[serde(rename = "arg")] - pub peer: &'a str, -} - -impl<'a> ApiRequest for DhtFindPeer<'a> { - const PATH: &'static str = "/dht/findpeer"; -} - -#[derive(Serialize)] -pub struct DhtFindProvs<'a> { - #[serde(rename = "arg")] - pub key: &'a str, -} - -impl<'a> ApiRequest for DhtFindProvs<'a> { - const PATH: &'static str = "/dht/findprovs"; -} - -#[derive(Serialize)] -pub struct DhtGet<'a> { - #[serde(rename = "arg")] - pub key: &'a str, -} - -impl<'a> ApiRequest for DhtGet<'a> { - const PATH: &'static str = "/dht/get"; -} - -#[derive(Serialize)] -pub struct DhtProvide<'a> { - #[serde(rename = "arg")] - pub key: &'a str, -} - -impl<'a> ApiRequest for DhtProvide<'a> { - const PATH: &'static str = "/dht/provide"; -} - -#[derive(Serialize)] -pub struct DhtPut<'a> { - #[serde(rename = "arg")] - pub key: &'a str, - - #[serde(rename = "arg")] - pub value: &'a str, -} - -impl<'a> ApiRequest for DhtPut<'a> { - const PATH: &'static str = "/dht/put"; -} - -#[derive(Serialize)] -pub struct DhtQuery<'a> { - #[serde(rename = "arg")] - pub peer: &'a str, -} - -impl<'a> ApiRequest for DhtQuery<'a> { - const PATH: &'static str = "/dht/query"; -} diff --git a/ipfs-api/src/request/diag.rs b/ipfs-api/src/request/diag.rs deleted file mode 100644 index 93e4c5c..0000000 --- a/ipfs-api/src/request/diag.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -pub struct DiagCmdsClear; - -impl_skip_serialize!(DiagCmdsClear); - -impl ApiRequest for DiagCmdsClear { - const PATH: &'static str = "/diag/cmds/clear"; -} - -#[derive(Serialize)] -pub struct DiagCmdsSetTime<'a> { - #[serde(rename = "arg")] - pub time: &'a str, -} - -impl<'a> ApiRequest for DiagCmdsSetTime<'a> { - const PATH: &'static str = "/diag/cmds/set-time"; -} - -pub struct DiagSys; - -impl_skip_serialize!(DiagSys); - -impl ApiRequest for DiagSys { - const PATH: &'static str = "/diag/sys"; -} diff --git a/ipfs-api/src/request/dns.rs b/ipfs-api/src/request/dns.rs deleted file mode 100644 index 61702cc..0000000 --- a/ipfs-api/src/request/dns.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct Dns<'a> { - #[serde(rename = "arg")] - pub link: &'a str, - - pub recursive: bool, -} - -impl<'a> ApiRequest for Dns<'a> { - const PATH: &'static str = "/dns"; -} diff --git a/ipfs-api/src/request/file.rs b/ipfs-api/src/request/file.rs deleted file mode 100644 index 4381f80..0000000 --- a/ipfs-api/src/request/file.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct FileLs<'a> { - #[serde(rename = "arg")] - pub path: &'a str, -} - -impl<'a> ApiRequest for FileLs<'a> { - const PATH: &'static str = "/file/ls"; -} diff --git a/ipfs-api/src/request/files.rs b/ipfs-api/src/request/files.rs deleted file mode 100644 index 64cf874..0000000 --- a/ipfs-api/src/request/files.rs +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize, Default)] -pub struct FilesCp<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - #[serde(rename = "arg")] - pub dest: &'a str, - - pub flush: Option<bool>, -} - -impl<'a> ApiRequest for FilesCp<'a> { - const PATH: &'static str = "/files/cp"; -} - -#[derive(Serialize)] -pub struct FilesFlush<'a> { - #[serde(rename = "arg")] - pub path: Option<&'a str>, -} - -impl<'a> ApiRequest for FilesFlush<'a> { - const PATH: &'static str = "/files/flush"; -} - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -pub struct FilesLs<'a> { - #[serde(rename = "arg")] - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub path: Option<&'a str>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub long: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - #[serde(rename = "U")] - pub unsorted: Option<bool>, -} - -impl<'a> ApiRequest for FilesLs<'a> { - const PATH: &'static str = "/files/ls"; -} - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -#[serde(rename_all = "kebab-case")] -pub struct FilesMkdir<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub parents: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub hash: Option<&'a str>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub cid_version: Option<i32>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub flush: Option<bool>, -} - -impl<'a> ApiRequest for FilesMkdir<'a> { - const PATH: &'static str = "/files/mkdir"; -} - -#[derive(Serialize, Default)] -pub struct FilesMv<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - #[serde(rename = "arg")] - pub dest: &'a str, - - pub flush: Option<bool>, -} - -impl<'a> ApiRequest for FilesMv<'a> { - const PATH: &'static str = "/files/mv"; -} - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -pub struct FilesRead<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub offset: Option<i64>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub count: Option<i64>, -} - -impl<'a> ApiRequest for FilesRead<'a> { - const PATH: &'static str = "/files/read"; -} - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -pub struct FilesRm<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub recursive: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub flush: Option<bool>, -} - -impl<'a> ApiRequest for FilesRm<'a> { - const PATH: &'static str = "/files/rm"; -} - -#[derive(Serialize, Default)] -#[serde(rename_all = "kebab-case")] -pub struct FilesStat<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - pub with_local: Option<bool>, -} - -impl<'a> ApiRequest for FilesStat<'a> { - const PATH: &'static str = "/files/stat"; -} - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -#[serde(rename_all = "kebab-case")] -pub struct FilesWrite<'a> { - #[serde(rename = "arg")] - pub path: &'a str, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub create: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub truncate: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub parents: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub offset: Option<i64>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub count: Option<i64>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub raw_leaves: Option<bool>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub hash: Option<&'a str>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub cid_version: Option<i32>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub flush: Option<bool>, -} - -impl<'a> ApiRequest for FilesWrite<'a> { - const PATH: &'static str = "/files/write"; -} - -#[cfg_attr(feature = "with-builder", derive(TypedBuilder))] -#[derive(Serialize, Default)] -#[serde(rename_all = "kebab-case")] -pub struct FilesChcid<'a> { - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - #[serde(rename = "arg")] - pub path: Option<&'a str>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub hash: Option<&'a str>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub cid_version: Option<i32>, - - #[cfg_attr(feature = "with-builder", builder(default, setter(strip_option)))] - pub flush: Option<bool>, -} - -impl<'a> ApiRequest for FilesChcid<'a> { - const PATH: &'static str = "/files/chcid"; -} diff --git a/ipfs-api/src/request/filestore.rs b/ipfs-api/src/request/filestore.rs deleted file mode 100644 index 06f3c88..0000000 --- a/ipfs-api/src/request/filestore.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -pub struct FilestoreDups; - -impl_skip_serialize!(FilestoreDups); - -impl ApiRequest for FilestoreDups { - const PATH: &'static str = "/filestore/dups"; -} - -#[derive(Serialize)] -pub struct FilestoreLs<'a> { - #[serde(rename = "arg")] - pub cid: Option<&'a str>, -} - -impl<'a> ApiRequest for FilestoreLs<'a> { - const PATH: &'static str = "/filestore/ls"; -} - -#[derive(Serialize)] -pub struct FilestoreVerify<'a> { - #[serde(rename = "arg")] - pub cid: Option<&'a str>, -} - -impl<'a> ApiRequest for FilestoreVerify<'a> { - const PATH: &'static str = "/filestore/verify"; -} diff --git a/ipfs-api/src/request/get.rs b/ipfs-api/src/request/get.rs deleted file mode 100644 index 4e97dcf..0000000 --- a/ipfs-api/src/request/get.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct Get<'a> { - #[serde(rename = "arg")] - pub path: &'a str, -} - -impl<'a> ApiRequest for Get<'a> { - const PATH: &'static str = "/get"; -} diff --git a/ipfs-api/src/request/id.rs b/ipfs-api/src/request/id.rs deleted file mode 100644 index 999ad3b..0000000 --- a/ipfs-api/src/request/id.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::Serialize; - -#[derive(Serialize)] -pub struct Id<'a> { - #[serde(rename = "arg")] - pub peer: Option<&'a str>, -} - -impl<'a> ApiRequest for Id<'a> { - const PATH: &'static str = "/id"; -} diff --git a/ipfs-api/src/request/key.rs b/ipfs-api/src/request/key.rs deleted file mode 100644 index 8e447db..0000000 --- a/ipfs-api/src/request/key.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2017 rust-ipfs-api Developers -// -// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or -// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or -// http://opensource.org/licenses/MIT>, at your option. This file may not be -// copied, modified, or distributed except according to those terms. -// - -use crate::request::ApiRequest; -use crate::serde::{Serialize, Serializer}; - -#[derive(Copy, Clone)] -pub enum KeyType { - Rsa, - Ed25519, -} - -impl Serialize for KeyType { - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> - where - S: Serializer, - { - let s = match self { - KeyType::Rsa => "rsa", - KeyType::Ed25519 => "ed25519", - }; - - serializer.serialize_str(s) - } -} - -#[derive(Serialize)] -pub struct KeyGen<'a> { - #[serde(rename = "arg")] - pub name: &'a str, - - #[serde(rename = "type")] - pub kind: KeyType, - - pub size: i32, -} - -impl<'a> ApiRequest for KeyGen<'a> { - const PATH: &'static str = "/key/gen"; -} - -pub struct KeyList; - -impl_skip_serialize!(KeyL |