Address formatting, mispellings, lint errors from goreportcard
License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
parent
9af863e3e0
commit
af177bfde6
|
@ -6,6 +6,7 @@
|
|||
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
|
||||
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
|
||||
[![GoDoc](https://godoc.org/github.com/ipfs/ipfs-cluster?status.svg)](https://godoc.org/github.com/ipfs/ipfs-cluster)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/ipfs/ipfs-cluster)](https://goreportcard.com/report/github.com/ipfs/ipfs-cluster)
|
||||
[![Build Status](https://travis-ci.org/ipfs/ipfs-cluster.svg?branch=master)](https://travis-ci.org/ipfs/ipfs-cluster)
|
||||
[![Coverage Status](https://coveralls.io/repos/github/ipfs/ipfs-cluster/badge.svg?branch=master)](https://coveralls.io/github/ipfs/ipfs-cluster?branch=master)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import (
|
|||
)
|
||||
|
||||
// Cluster is the main IPFS cluster component. It provides
|
||||
// the go-API for it and orchestrates the componenets that make up the system.
|
||||
// the go-API for it and orchestrates the components that make up the system.
|
||||
type Cluster struct {
|
||||
ctx context.Context
|
||||
|
||||
|
@ -476,7 +476,7 @@ func (c *Cluster) globalPinInfoSlice(method string) ([]GlobalPinInfo, error) {
|
|||
|
||||
// Merge any errors
|
||||
for p, msg := range erroredPeers {
|
||||
for c, _ := range fullMap {
|
||||
for c := range fullMap {
|
||||
fullMap[c].Status[p] = PinInfo{
|
||||
CidStr: c,
|
||||
Peer: p,
|
||||
|
|
|
@ -253,7 +253,7 @@ func (cc *Consensus) Shutdown() error {
|
|||
}
|
||||
|
||||
if errMsgs != "" {
|
||||
errMsgs += "Consensus shutdown unsucessful"
|
||||
errMsgs += "Consensus shutdown unsuccessful"
|
||||
logger.Error(errMsgs)
|
||||
return errors.New(errMsgs)
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ func (cc *Consensus) LogPin(c *cid.Cid) error {
|
|||
// This means the op did not make it to the log
|
||||
return err
|
||||
}
|
||||
logger.Infof("pin commited to global state: %s", c)
|
||||
logger.Infof("pin committed to global state: %s", c)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ func (cc *Consensus) LogUnpin(c *cid.Cid) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logger.Infof("unpin commited to global state: %s", c)
|
||||
logger.Infof("unpin committed to global state: %s", c)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ const programName = `ipfs-cluster-service`
|
|||
|
||||
// Description provides a short summary of the functionality of this tool
|
||||
var Description = fmt.Sprintf(`
|
||||
%s runs an IPFS Cluster member (version %s).
|
||||
%s runs an IPFS Cluster peer (version %s).
|
||||
|
||||
A member is a node which participates in the cluster consensus, follows
|
||||
A peer is a node which participates in the cluster consensus, follows
|
||||
a distributed log of pinning and unpinning operations and manages pinning
|
||||
operations to a configured IPFS daemon.
|
||||
|
||||
|
|
18
rest_api.go
18
rest_api.go
|
@ -147,55 +147,55 @@ func NewRESTAPI(cfg *Config) (*RESTAPI, error) {
|
|||
|
||||
func (api *RESTAPI) routes() []route {
|
||||
return []route{
|
||||
route{
|
||||
{
|
||||
"Members",
|
||||
"GET",
|
||||
"/members",
|
||||
api.memberListHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"Pins",
|
||||
"GET",
|
||||
"/pins",
|
||||
api.pinListHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"Version",
|
||||
"GET",
|
||||
"/version",
|
||||
api.versionHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"Pin",
|
||||
"POST",
|
||||
"/pins/{hash}",
|
||||
api.pinHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"Unpin",
|
||||
"DELETE",
|
||||
"/pins/{hash}",
|
||||
api.unpinHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"Status",
|
||||
"GET",
|
||||
"/status",
|
||||
api.statusHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"StatusCid",
|
||||
"GET",
|
||||
"/status/{hash}",
|
||||
api.statusCidHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"Sync",
|
||||
"POST",
|
||||
"/status",
|
||||
api.syncHandler,
|
||||
},
|
||||
route{
|
||||
{
|
||||
"SyncCid",
|
||||
"POST",
|
||||
"/status/{hash}",
|
||||
|
|
|
@ -58,10 +58,10 @@ func (mock *mockService) Status(in struct{}, out *[]GlobalPinInfo) error {
|
|||
c2, _ := cid.Decode(testCid2)
|
||||
c3, _ := cid.Decode(testCid3)
|
||||
*out = []GlobalPinInfo{
|
||||
GlobalPinInfo{
|
||||
{
|
||||
Cid: c1,
|
||||
Status: map[peer.ID]PinInfo{
|
||||
testPeerID: PinInfo{
|
||||
testPeerID: {
|
||||
CidStr: testCid1,
|
||||
Peer: testPeerID,
|
||||
IPFS: Pinned,
|
||||
|
@ -69,10 +69,10 @@ func (mock *mockService) Status(in struct{}, out *[]GlobalPinInfo) error {
|
|||
},
|
||||
},
|
||||
},
|
||||
GlobalPinInfo{
|
||||
{
|
||||
Cid: c2,
|
||||
Status: map[peer.ID]PinInfo{
|
||||
testPeerID: PinInfo{
|
||||
testPeerID: {
|
||||
CidStr: testCid2,
|
||||
Peer: testPeerID,
|
||||
IPFS: Pinning,
|
||||
|
@ -80,10 +80,10 @@ func (mock *mockService) Status(in struct{}, out *[]GlobalPinInfo) error {
|
|||
},
|
||||
},
|
||||
},
|
||||
GlobalPinInfo{
|
||||
{
|
||||
Cid: c3,
|
||||
Status: map[peer.ID]PinInfo{
|
||||
testPeerID: PinInfo{
|
||||
testPeerID: {
|
||||
CidStr: testCid3,
|
||||
Peer: testPeerID,
|
||||
IPFS: PinError,
|
||||
|
@ -103,7 +103,7 @@ func (mock *mockService) StatusCid(in *CidArg, out *GlobalPinInfo) error {
|
|||
*out = GlobalPinInfo{
|
||||
Cid: c1,
|
||||
Status: map[peer.ID]PinInfo{
|
||||
testPeerID: PinInfo{
|
||||
testPeerID: {
|
||||
CidStr: testCid1,
|
||||
Peer: testPeerID,
|
||||
IPFS: Pinned,
|
||||
|
|
Loading…
Reference in New Issue
Block a user