This commit adds support for the --api option, which allows users
to specify an API endpoint to run the cli command against. It enables
much easier control of remote daemons.
It also
- ensures the API server version matches the API client
- implements support for the $IPFS_PATH/api file
Still TODO:
- tests!
- multiaddr to support /dns/
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
The pkg.Interface style is modeled after heap.Interface. Generally, I
find it helpful for interfaces that have many implementations. It
provides clear distinction between the generic interface and the |n|
implementations that implement it (which may be interface types
themselves).
For clients who cannot keep the repo name, one can imagine that the most
likely rename is `ipfsrepo`. In that case, `ipfsrepo.Interface` remains
meaningful.
This is low-pri so it doesn't matter than much. But for the record, the
repo.Interface feels appropriate in this use-case.