aboutsummaryrefslogtreecommitdiff
path: root/go/weed/upload.go
diff options
context:
space:
mode:
authoryourchanges <yourchanges@gmail.com>2014-10-21 15:50:48 +0800
committeryourchanges <yourchanges@gmail.com>2014-10-21 15:50:48 +0800
commitf7bcd8e958ef185baeca0c455a397d49fcb62256 (patch)
treebb2a2de4fcb7f9ac7e1d65a78e82cbe1f5f17e36 /go/weed/upload.go
parent78ccbbf3d0766e1ececf91fa00766d1ed33050cc (diff)
parenta3c17f17b144c4298409fddda2d6bc4b39d38ca5 (diff)
downloadseaweedfs-f7bcd8e958ef185baeca0c455a397d49fcb62256.tar.xz
seaweedfs-f7bcd8e958ef185baeca0c455a397d49fcb62256.zip
Merge pull request #1 from chrislusf/master
update
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 b59313a2a..4eae4d274 100644
--- a/go/weed/upload.go
+++ b/go/weed/upload.go
@@ -1,7 +1,7 @@
package main
import (
- "code.google.com/p/weed-fs/go/operation"
+ "github.com/chrislusf/weed-fs/go/operation"
"encoding/json"
"fmt"
"os"
@@ -12,6 +12,7 @@ var (
uploadReplication *string
uploadCollection *string
uploadDir *string
+ uploadTtl *string
include *string
maxMB *int
)
@@ -24,6 +25,7 @@ func init() {
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")
uploadCollection = cmdUpload.Flag.String("collection", "", "optional collection name")
+ uploadTtl = cmdUpload.Flag.String("ttl", "", "time to live, e.g.: 1m, 1h, 1d, 1M, 1y")
maxMB = cmdUpload.Flag.Int("maxMB", 0, "split files larger than the limit")
}
@@ -67,7 +69,7 @@ func runUpload(cmd *Command, args []string) bool {
if e != nil {
return e
}
- results, e := operation.SubmitFiles(*server, parts, *uploadReplication, *uploadCollection, *maxMB)
+ results, e := operation.SubmitFiles(*server, parts, *uploadReplication, *uploadCollection, *uploadTtl, *maxMB)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
if e != nil {
@@ -84,7 +86,7 @@ func runUpload(cmd *Command, args []string) bool {
if e != nil {
fmt.Println(e.Error())
}
- results, _ := operation.SubmitFiles(*server, parts, *uploadReplication, *uploadCollection, *maxMB)
+ results, _ := operation.SubmitFiles(*server, parts, *uploadReplication, *uploadCollection, *uploadTtl, *maxMB)
bytes, _ := json.Marshal(results)
fmt.Println(string(bytes))
}