ipfs-cluster/api/rest/client
Hector Sanjuan b6306a6e61 Add endpoints output: improvements and compliance
This straigthens some mistakes with the outputs of the /add endpoints.

Currently, we had exactly the same output format which:

* was not exactly the ipfs API output format but was sort of similar
* made some weird concessions to be compatible (like having a string-type "size")
* was not aligned with Cluster API conventions (lowercase keys)

This corrects all this:

* The Cluster API /add output format now uses the right types and lowercase keys.
* `Hash` is now `Cid`, because the field carries a Cid.
* We copy error handling with request trailers from IPFS, and avoid carrying the
  errors in the output objects.
* The proxy now returns exactly the types as ipfs would
* We add the X-Chunked-Output: 1 header, which is custom and redundant, but
otherwise breaks js-ipfs-api integrations with the /add endpoint.

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2018-10-04 00:57:36 +02:00
..
.travis.yml Fix #260: Add REST API client and use it in ipfs-cluster-ctl 2017-12-06 20:12:01 +01:00
client_test.go Add Client interface, implemented by defaultClient 2018-09-27 16:51:34 -07:00
client.go Fix IPFS() method missing in Client interface 2018-10-01 20:09:26 +02:00
methods_test.go Add endpoints output: improvements and compliance 2018-10-04 00:57:36 +02:00
methods.go Add endpoints output: improvements and compliance 2018-10-04 00:57:36 +02:00
README.md Fix #260: Add REST API client and use it in ipfs-cluster-ctl 2017-12-06 20:12:01 +01:00
request.go Add endpoints output: improvements and compliance 2018-10-04 00:57:36 +02:00
transports.go Add Client interface, implemented by defaultClient 2018-09-27 16:51:34 -07:00

ipfs-cluster client

Made by Main project IRC channel standard-readme compliant GoDoc Go Report Card Build Status Coverage Status

Go client for ipfs-cluster HTTP API.

This is a Go client library to use the ipfs-cluster REST HTTP API.

Table of Contents

Install

You can import github.com/ipfs/ipfs-cluster/api/rest/client in your code. If you wish to use gx for dependency management, it can be imported with:

$ gx import github.com/ipfs/ipfs-cluster/

The code can be downloaded and tested with:

$ go get -u -d github.com/ipfs/ipfs-cluster
$ cd $GOPATH/src/github.com/ipfs/ipfs-cluster/rest/api/client
$ go test -v

Usage

Documentation can be read at Godoc.

Contribute

PRs accepted.

License

MIT © Protocol Labs