aboutsummaryrefslogtreecommitdiff
path: root/go/weed/upload.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-08-14 10:07:42 -0700
committerChris Lu <chris.lu@gmail.com>2013-08-14 10:07:42 -0700
commit8e1ac16d1625612e8c33eb2e736efcebbdab32e9 (patch)
tree5d92e21c6221cc9dfb7ecf27d3a34ff88b7b25fa /go/weed/upload.go
parent48e4ced29d86d0cc2e525b727ae3fdcd3cbacf91 (diff)
downloadseaweedfs-8e1ac16d1625612e8c33eb2e736efcebbdab32e9.tar.xz
seaweedfs-8e1ac16d1625612e8c33eb2e736efcebbdab32e9.zip
refactoring submit operation
Diffstat (limited to 'go/weed/upload.go')
-rw-r--r--go/weed/upload.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/go/weed/upload.go b/go/weed/upload.go
index 8c0469595..215a320a5 100644
--- a/go/weed/upload.go
+++ b/go/weed/upload.go
@@ -56,7 +56,11 @@ func runUpload(cmd *Command, args []string) bool {
return nil
}
}
- results, e := operation.SubmitFiles(*server, []string{path}, *uploadReplication)
+ parts, e := operation.NewFileParts([]string{path})
+ if e != nil {
+ return e
+ }
+ results, e := operation.SubmitFiles(*server, parts, *uploadReplication)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
@@ -69,7 +73,11 @@ func runUpload(cmd *Command, args []string) bool {
return err
})
} else {
- results, _ := operation.SubmitFiles(*server, args, *uploadReplication)
+ parts, e := operation.NewFileParts(args)
+ if e != nil {
+ fmt.Println(e.Error())
+ }
+ results, _ := operation.SubmitFiles(*server, parts, *uploadReplication)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
}