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

@@ -18,9 +18,9 @@ package cmd
import (
"errors"
"net/url"
pathutil "path"
"runtime"
"strconv"
"sync"
"github.com/minio/dsync"
@@ -31,13 +31,13 @@ var nsMutex *nsLockMap
// Initialize distributed locking only in case of distributed setup.
// Returns if the setup is distributed or not on success.
func initDsyncNodes(eps []storageEndPoint) error {
func initDsyncNodes(eps []*url.URL) error {
cred := serverConfig.GetCredential()
// Initialize rpc lock client information only if this instance is a distributed setup.
var clnts []dsync.RPC
myNode := -1
for _, ep := range eps {
if ep.host == "" || ep.port == 0 || ep.path == "" {
if ep == nil {
return errInvalidArgument
}
clnts = append(clnts, newAuthClient(&authConfig{
@@ -45,9 +45,9 @@ func initDsyncNodes(eps []storageEndPoint) error {
secretKey: cred.SecretAccessKey,
// Construct a new dsync server addr.
secureConn: isSSL(),
address: ep.host + ":" + strconv.Itoa(ep.port),
address: ep.Host,
// Construct a new rpc path for the endpoint.
path: pathutil.Join(lockRPCPath, ep.path),
path: pathutil.Join(lockRPCPath, getPath(ep)),
loginMethod: "Dsync.LoginHandler",
}))
if isLocalStorage(ep) && myNode == -1 {