Move to URL based syntax formatting. (#3092)

For command line arguments we are currently following

- <node-1>:/path ... <node-n>:/path

This patch changes this to

- http://<node-1>/path ... http://<node-n>/path
This commit is contained in:
Harshavardhana
2016-10-27 03:30:52 -07:00
committed by GitHub
parent 30dc11a931
commit 9e2d0ac50b
36 changed files with 560 additions and 474 deletions

View File

@@ -20,6 +20,7 @@ import (
"encoding/json"
"fmt"
"net/rpc"
"net/url"
"path"
"sync"
"time"
@@ -39,7 +40,7 @@ type s3Peers struct {
peers []string
}
func initGlobalS3Peers(eps []storageEndPoint) {
func initGlobalS3Peers(eps []*url.URL) {
// Get list of de-duplicated peers.
peers := getAllPeers(eps)
@@ -111,16 +112,17 @@ func (s3p *s3Peers) Close() error {
}
// Returns the network addresses of all Minio servers in the cluster in `host:port` format.
func getAllPeers(eps []storageEndPoint) (peers []string) {
func getAllPeers(eps []*url.URL) (peers []string) {
if eps == nil {
return nil
}
peers = []string{globalMinioAddr} // Starts with a default peer.
for _, ep := range eps {
// Rest of the peers configured.
if ep.host != "" {
peers = append(peers, fmt.Sprintf("%s:%d", ep.host, ep.port))
if ep == nil {
return nil
}
// Rest of the peers configured.
peers = append(peers, ep.Host)
}
return peers
}