aboutsummaryrefslogtreecommitdiff
path: root/go/weed/upload.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/weed/upload.go')
-rw-r--r--go/weed/upload.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/go/weed/upload.go b/go/weed/upload.go
index 42e753981..b59313a2a 100644
--- a/go/weed/upload.go
+++ b/go/weed/upload.go
@@ -10,6 +10,7 @@ import (
var (
uploadReplication *string
+ uploadCollection *string
uploadDir *string
include *string
maxMB *int
@@ -21,7 +22,8 @@ func init() {
server = cmdUpload.Flag.String("server", "localhost:9333", "weedfs master location")
uploadDir = cmdUpload.Flag.String("dir", "", "Upload the whole folder recursively if specified.")
include = cmdUpload.Flag.String("include", "", "pattens of files to upload, e.g., *.pdf, *.html, ab?d.txt, works together with -dir")
- uploadReplication = cmdUpload.Flag.String("replication", "", "replication type(000,001,010,100,110,200)")
+ uploadReplication = cmdUpload.Flag.String("replication", "", "replication type")
+ uploadCollection = cmdUpload.Flag.String("collection", "", "optional collection name")
maxMB = cmdUpload.Flag.Int("maxMB", 0, "split files larger than the limit")
}
@@ -65,7 +67,7 @@ func runUpload(cmd *Command, args []string) bool {
if e != nil {
return e
}
- results, e := operation.SubmitFiles(*server, parts, *uploadReplication, *maxMB)
+ results, e := operation.SubmitFiles(*server, parts, *uploadReplication, *uploadCollection, *maxMB)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
@@ -82,7 +84,7 @@ func runUpload(cmd *Command, args []string) bool {
if e != nil {
fmt.Println(e.Error())
}
- results, _ := operation.SubmitFiles(*server, parts, *uploadReplication, *maxMB)
+ results, _ := operation.SubmitFiles(*server, parts, *uploadReplication, *uploadCollection, *maxMB)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
}