package
0.0.0-20191101101117-7375b2fc63f1
Repository: https://github.com/glvd/cluster.git
Documentation: pkg.go.dev

# README

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/glvd/cluster/api/rest/client in your code.

The code can be downloaded and tested with:

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

Usage

Documentation can be read at Godoc.

Contribute

PRs accepted.

License

MIT © Protocol Labs

# Functions

IsPeerAddress detects if the given multiaddress identifies a libp2p peer, either because it has the /p2p/ protocol or because it uses /dnsaddr/.
NewDefaultClient initializes a client given a Config.
NewLBClient returns a new client that would load balance requests among clients.
WaitFor is a utility function that allows for a caller to wait for a paticular status for a CID (as defined by StatusFilterParams).

# Variables

Configuration defaults.
Configuration defaults.
Configuration defaults.
Configuration defaults.
Configuration defaults.
Configuration defaults.

# Structs

Config allows to configure the parameters to connect to the ipfs-cluster REST API.
Failover is a load balancing strategy that would try the local cluster peer first.
RoundRobin is a load balancing strategy that would use clients in a sequence.
StatusFilterParams contains the parameters required to filter a stream of status results.

# Interfaces

Client interface defines the interface to be used by API clients to interact with the ipfs-cluster-service.
LBStrategy is a strategy to load balance requests among clients.