summaryrefslogtreecommitdiffstats
path: root/ipfs-api
diff options
context:
space:
mode:
authorFerris Tseng <ferristseng@fastmail.fm>2017-10-25 23:00:48 -0400
committerFerris Tseng <ferristseng@fastmail.fm>2017-10-25 23:00:48 -0400
commit8b055e583721b833d8528323dc0ad93ec9f5bc00 (patch)
treea94e87003828c265165e481b483fbfbcf5e34b46 /ipfs-api
parentec44a1db8ba7973386bca7fca7b51f1a5647f69e (diff)
add license
Diffstat (limited to 'ipfs-api')
-rw-r--r--ipfs-api/Cargo.toml1
-rw-r--r--ipfs-api/examples/add_file.rs8
-rw-r--r--ipfs-api/examples/bootstrap_default.rs8
-rw-r--r--ipfs-api/examples/dns.rs8
-rw-r--r--ipfs-api/examples/get_commands.rs8
-rw-r--r--ipfs-api/examples/get_stats.rs8
-rw-r--r--ipfs-api/examples/get_swarm.rs8
-rw-r--r--ipfs-api/examples/get_version.rs34
-rw-r--r--ipfs-api/examples/ping_peer.rs8
-rw-r--r--ipfs-api/examples/pubsub.rs8
-rw-r--r--ipfs-api/src/client.rs8
-rw-r--r--ipfs-api/src/lib.rs8
-rw-r--r--ipfs-api/src/read.rs8
-rw-r--r--ipfs-api/src/request/add.rs8
-rw-r--r--ipfs-api/src/request/bitswap.rs8
-rw-r--r--ipfs-api/src/request/block.rs8
-rw-r--r--ipfs-api/src/request/bootstrap.rs8
-rw-r--r--ipfs-api/src/request/cat.rs8
-rw-r--r--ipfs-api/src/request/commands.rs8
-rw-r--r--ipfs-api/src/request/config.rs8
-rw-r--r--ipfs-api/src/request/dag.rs8
-rw-r--r--ipfs-api/src/request/dht.rs8
-rw-r--r--ipfs-api/src/request/diag.rs8
-rw-r--r--ipfs-api/src/request/dns.rs8
-rw-r--r--ipfs-api/src/request/file.rs8
-rw-r--r--ipfs-api/src/request/ls.rs8
-rw-r--r--ipfs-api/src/request/mod.rs8
-rw-r--r--ipfs-api/src/request/object.rs8
-rw-r--r--ipfs-api/src/request/pin.rs8
-rw-r--r--ipfs-api/src/request/ping.rs8
-rw-r--r--ipfs-api/src/request/pubsub.rs8
-rw-r--r--ipfs-api/src/request/refs.rs8
-rw-r--r--ipfs-api/src/request/stats.rs8
-rw-r--r--ipfs-api/src/request/swarm.rs8
-rw-r--r--ipfs-api/src/request/version.rs8
-rw-r--r--ipfs-api/src/response/add.rs8
-rw-r--r--ipfs-api/src/response/bitswap.rs8
-rw-r--r--ipfs-api/src/response/block.rs8
-rw-r--r--ipfs-api/src/response/bootstrap.rs8
-rw-r--r--ipfs-api/src/response/cat.rs8
-rw-r--r--ipfs-api/src/response/commands.rs8
-rw-r--r--ipfs-api/src/response/config.rs8
-rw-r--r--ipfs-api/src/response/dag.rs8
-rw-r--r--ipfs-api/src/response/dht.rs8
-rw-r--r--ipfs-api/src/response/diag.rs8
-rw-r--r--ipfs-api/src/response/dns.rs8
-rw-r--r--ipfs-api/src/response/error.rs8
-rw-r--r--ipfs-api/src/response/file.rs8
-rw-r--r--ipfs-api/src/response/files.rs8
-rw-r--r--ipfs-api/src/response/filestore.rs8
-rw-r--r--ipfs-api/src/response/get.rs8
-rw-r--r--ipfs-api/src/response/id.rs8
-rw-r--r--ipfs-api/src/response/key.rs8
-rw-r--r--ipfs-api/src/response/log.rs8
-rw-r--r--ipfs-api/src/response/ls.rs8
-rw-r--r--ipfs-api/src/response/mod.rs8
-rw-r--r--ipfs-api/src/response/mount.rs8
-rw-r--r--ipfs-api/src/response/name.rs8
-rw-r--r--ipfs-api/src/response/object.rs8
-rw-r--r--ipfs-api/src/response/pin.rs8
-rw-r--r--ipfs-api/src/response/ping.rs8
-rw-r--r--ipfs-api/src/response/pubsub.rs8
-rw-r--r--ipfs-api/src/response/refs.rs8
-rw-r--r--ipfs-api/src/response/repo.rs8
-rw-r--r--ipfs-api/src/response/resolve.rs8
-rw-r--r--ipfs-api/src/response/serde.rs8
-rw-r--r--ipfs-api/src/response/stats.rs8
-rw-r--r--ipfs-api/src/response/swarm.rs8
-rw-r--r--ipfs-api/src/response/tar.rs8
-rw-r--r--ipfs-api/src/response/version.rs8
70 files changed, 579 insertions, 0 deletions
diff --git a/ipfs-api/Cargo.toml b/ipfs-api/Cargo.toml
index e5acf4a..abf8189 100644
--- a/ipfs-api/Cargo.toml
+++ b/ipfs-api/Cargo.toml
@@ -1,6 +1,7 @@
[package]
name = "ipfs-api"
version = "0.4.0"
+license = "MIT OR Apache-2.0"
authors = ["Ferris Tseng <ferristseng@fastmail.fm>"]
[dependencies]
diff --git a/ipfs-api/examples/add_file.rs b/ipfs-api/examples/add_file.rs
index da991cf..66775f4 100644
--- a/ipfs-api/examples/add_file.rs
+++ b/ipfs-api/examples/add_file.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/bootstrap_default.rs b/ipfs-api/examples/bootstrap_default.rs
index 90126b5..739167d 100644
--- a/ipfs-api/examples/bootstrap_default.rs
+++ b/ipfs-api/examples/bootstrap_default.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/dns.rs b/ipfs-api/examples/dns.rs
index 20c47e7..a4e0450 100644
--- a/ipfs-api/examples/dns.rs
+++ b/ipfs-api/examples/dns.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/get_commands.rs b/ipfs-api/examples/get_commands.rs
index ecf5b0e..d3f9852 100644
--- a/ipfs-api/examples/get_commands.rs
+++ b/ipfs-api/examples/get_commands.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/get_stats.rs b/ipfs-api/examples/get_stats.rs
index d3c7ea1..3895de6 100644
--- a/ipfs-api/examples/get_stats.rs
+++ b/ipfs-api/examples/get_stats.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/get_swarm.rs b/ipfs-api/examples/get_swarm.rs
index 34a4096..207642b 100644
--- a/ipfs-api/examples/get_swarm.rs
+++ b/ipfs-api/examples/get_swarm.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/get_version.rs b/ipfs-api/examples/get_version.rs
index 4eaf7cc..257d1c7 100644
--- a/ipfs-api/examples/get_version.rs
+++ b/ipfs-api/examples/get_version.rs
@@ -1,6 +1,16 @@
+// 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.
+//
+
+extern crate futures;
extern crate ipfs_api;
extern crate tokio_core;
+use futures::stream::Stream;
use ipfs_api::IpfsClient;
use tokio_core::reactor::Core;
@@ -15,4 +25,28 @@ fn main() {
let version = core.run(req).expect("expected a valid response");
println!("version: {:?}", version.version);
+
+ let req = client.refs_local();
+ println!(
+ "{:?}",
+ core.run(req.for_each(|res| Ok(println!("{:?}", res))))
+ );
+
+ let req = client.diag_sys();
+ println!("{}", core.run(req).expect("response"));
+
+ let req = client.dns("ipfs.io", false);
+ let dns = core.run(req).expect("response");
+ println!("{:?}", dns);
+
+ let req = client.file_ls(&dns.path[..]);
+ println!("{:?}", core.run(req).expect("response"));
+
+ /*
+ let req = client.dht_get("QmRJijhiMxQgn7bFP4cBsarHsGMM8g9fLDEE3WtkTXr4Hr");
+ println!(
+ "{:?}",
+ core.run(req.for_each(|res| Ok(println!("{:?}", res))))
+ );
+ */
}
diff --git a/ipfs-api/examples/ping_peer.rs b/ipfs-api/examples/ping_peer.rs
index a4d5f5a..0e802a5 100644
--- a/ipfs-api/examples/ping_peer.rs
+++ b/ipfs-api/examples/ping_peer.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate futures;
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/examples/pubsub.rs b/ipfs-api/examples/pubsub.rs
index 23b1dc6..ad88b0b 100644
--- a/ipfs-api/examples/pubsub.rs
+++ b/ipfs-api/examples/pubsub.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate futures;
extern crate ipfs_api;
extern crate tokio_core;
diff --git a/ipfs-api/src/client.rs b/ipfs-api/src/client.rs
index 9f15f89..e0363d4 100644
--- a/ipfs-api/src/client.rs
+++ b/ipfs-api/src/client.rs
@@ -1,3 +1,11 @@
+// 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 futures::Stream;
use futures::future::{Future, IntoFuture};
use read::{JsonLineDecoder, StreamReader};
diff --git a/ipfs-api/src/lib.rs b/ipfs-api/src/lib.rs
index cdd9f70..b3840f5 100644
--- a/ipfs-api/src/lib.rs
+++ b/ipfs-api/src/lib.rs
@@ -1,3 +1,11 @@
+// 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.
+//
+
extern crate bytes;
#[macro_use]
extern crate error_chain;
diff --git a/ipfs-api/src/read.rs b/ipfs-api/src/read.rs
index eb63023..567b823 100644
--- a/ipfs-api/src/read.rs
+++ b/ipfs-api/src/read.rs
@@ -1,3 +1,11 @@
+// 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 bytes::BytesMut;
use futures::{Async, Stream};
use reqwest::unstable::async;
diff --git a/ipfs-api/src/request/add.rs b/ipfs-api/src/request/add.rs
index a7daac5..31458ea 100644
--- a/ipfs-api/src/request/add.rs
+++ b/ipfs-api/src/request/add.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/bitswap.rs b/ipfs-api/src/request/bitswap.rs
index 8be4cbe..0c0953e 100644
--- a/ipfs-api/src/request/bitswap.rs
+++ b/ipfs-api/src/request/bitswap.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/block.rs b/ipfs-api/src/request/block.rs
index cbdf62c..87cfe54 100644
--- a/ipfs-api/src/request/block.rs
+++ b/ipfs-api/src/request/block.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/bootstrap.rs b/ipfs-api/src/request/bootstrap.rs
index 98e3874..3ff8bf8 100644
--- a/ipfs-api/src/request/bootstrap.rs
+++ b/ipfs-api/src/request/bootstrap.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/cat.rs b/ipfs-api/src/request/cat.rs
index 20e98e3..ec182e3 100644
--- a/ipfs-api/src/request/cat.rs
+++ b/ipfs-api/src/request/cat.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/commands.rs b/ipfs-api/src/request/commands.rs
index 00b90c9..515ddb5 100644
--- a/ipfs-api/src/request/commands.rs
+++ b/ipfs-api/src/request/commands.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/config.rs b/ipfs-api/src/request/config.rs
index 36f0c06..cdbd835 100644
--- a/ipfs-api/src/request/config.rs
+++ b/ipfs-api/src/request/config.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/dag.rs b/ipfs-api/src/request/dag.rs
index d30613a..d883ca5 100644
--- a/ipfs-api/src/request/dag.rs
+++ b/ipfs-api/src/request/dag.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/dht.rs b/ipfs-api/src/request/dht.rs
index 3b9fccf..877a69a 100644
--- a/ipfs-api/src/request/dht.rs
+++ b/ipfs-api/src/request/dht.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/diag.rs b/ipfs-api/src/request/diag.rs
index fefe99a..315d474 100644
--- a/ipfs-api/src/request/diag.rs
+++ b/ipfs-api/src/request/diag.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/dns.rs b/ipfs-api/src/request/dns.rs
index 7aa869b..4ac2000 100644
--- a/ipfs-api/src/request/dns.rs
+++ b/ipfs-api/src/request/dns.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/file.rs b/ipfs-api/src/request/file.rs
index ea4b22e..4d8c42f 100644
--- a/ipfs-api/src/request/file.rs
+++ b/ipfs-api/src/request/file.rs
@@ -1,3 +1,11 @@
+// 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 request::ApiRequest;
diff --git a/ipfs-api/src/request/ls.rs b/ipfs-api/src/request/ls.rs
index 06bf661..eb3cfda 100644
--- a/ipfs-api/src/request/ls.rs
+++ b/ipfs-api/src/request/ls.rs
@@ -1,3 +1,11 @@
+// Copyright 2017 rust-ipfs-api Developers
+//
+// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or