ipfs-api
Components
Name | Documentation | Crate |
---|---|---|
ipfs-api-prelude | ||
ipfs-api-backend-actix | ||
ipfs-api-backend-hyper | ||
ipfs-api (deprecated) |
Rust library for connecting to the IPFS HTTP API using Hyper/Actix.
Usage
Using Hyper
To use the Hyper backend, declare:
You can specify either with-hyper-rustls
or with-hyper-tls
(mutually exclusive) feature for TLS support.
Using Actix
To use the Actix backend, declare:
Builder Pattern
With either the Hyper or Actix backend, you can specify the with-builder
feature to enable a builder pattern to use when building requests.
Usage (DEPRECATED)
Feature Flags (DEPRECATED)
You can use actix-web
as a backend instead of hyper
.
You also have the option of using rustls
instead of native tls:
To enable the builder pattern (default) use the with-builder
feature:
Examples
Writing a file to IPFS
With Hyper
With Actix
Reading a file from IPFS
With Hyper
With Actix
Additional Examples
There are also a bunch of examples included in the project, which I used for testing
For a list of examples, run:
You can run any of the examples with cargo:
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or #404)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.