1
0
mirror of https://github.com/minio/mc.git synced 2025-11-12 01:02:26 +03:00

Revert "unstruct client functions"

This commit is contained in:
Harshavardhana
2015-04-29 21:28:28 -07:00
parent 3ec4e85f92
commit 1ceed3dc20
10 changed files with 63 additions and 54 deletions

View File

@@ -59,16 +59,16 @@ func runCatCmd(ctx *cli.Context) {
log.Debug.Println(iodine.New(err, nil))
console.Fatalf("reading host config for URL [%s] failed with following reason: [%s]\n", sourceURLs, iodine.ToError(err))
}
humanReadable, err := doCatCmd(sourceURLConfigMap, standardOutput, globalDebugFlag)
humanReadable, err := doCatCmd(mcClientMethods{}, sourceURLConfigMap, standardOutput, globalDebugFlag)
if err != nil {
log.Debug.Println(iodine.New(err, nil))
console.Fatalln(humanReadable)
}
}
func doCatCmd(sourceURLConfigMap map[string]*hostConfig, targetURL string, debug bool) (string, error) {
func doCatCmd(methods clientMethods, sourceURLConfigMap map[string]*hostConfig, targetURL string, debug bool) (string, error) {
for url, config := range sourceURLConfigMap {
sourceClnt, err := getNewClient(url, config, debug)
sourceClnt, err := methods.getNewClient(url, config, debug)
if err != nil {
return "Unable to create client: " + url, iodine.New(err, nil)
}
@@ -78,7 +78,7 @@ func doCatCmd(sourceURLConfigMap map[string]*hostConfig, targetURL string, debug
}
defer reader.Close()
stdOutClnt, err := getNewClient(targetURL, &hostConfig{}, debug)
stdOutClnt, err := methods.getNewClient(targetURL, &hostConfig{}, debug)
if err != nil {
return "Unable to create client: " + url, iodine.New(err, nil)
}