diff options
| author | Chris Lu <chris.lu@gmail.com> | 2014-04-15 10:01:13 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2014-04-15 10:01:13 -0700 |
| commit | 4ecf5956d799ff67d91a586563075400899510da (patch) | |
| tree | 7bee1224446ca8dd3450430cb3bf2cacf8f53dd4 /go/operation/submit.go | |
| parent | 7ad6cd35e88009bc9703f47ad5c9ab4f400110f8 (diff) | |
| download | seaweedfs-4ecf5956d799ff67d91a586563075400899510da.tar.xz seaweedfs-4ecf5956d799ff67d91a586563075400899510da.zip | |
Add types to uploading
Diffstat (limited to 'go/operation/submit.go')
| -rw-r--r-- | go/operation/submit.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/go/operation/submit.go b/go/operation/submit.go index 693b90db1..9191f7d9a 100644 --- a/go/operation/submit.go +++ b/go/operation/submit.go @@ -25,11 +25,11 @@ type FilePart struct { } type SubmitResult struct { - FileName string `json:"fileName"` - FileUrl string `json:"fileUrl"` - Fid string `json:"fid"` - Size int `json:"size"` - Error string `json:"error"` + FileName string `json:"fileName,omitempty"` + FileUrl string `json:"fileUrl,omitempty"` + Fid string `json:"fid,omitempty"` + Size uint32 `json:"size,omitempty"` + Error string `json:"error,omitempty"` } func SubmitFiles(master string, files []FilePart, replication string, collection string, maxMB int) ([]SubmitResult, error) { @@ -99,7 +99,7 @@ func newFilePart(fullPathFilename string) (ret FilePart, err error) { return ret, nil } -func (fi FilePart) Upload(maxMB int, master string) (retSize int, err error) { +func (fi FilePart) Upload(maxMB int, master string) (retSize uint32, err error) { fileUrl := "http://" + fi.Server + "/" + fi.Fid if fi.ModTime != 0 { fileUrl += "?ts=" + strconv.Itoa(int(fi.ModTime)) @@ -130,7 +130,7 @@ func (fi FilePart) Upload(maxMB int, master string) (retSize int, err error) { return } -func upload_one_chunk(filename string, reader io.Reader, master, replication string, collection string) (fid string, size int, e error) { +func upload_one_chunk(filename string, reader io.Reader, master, replication string, collection string) (fid string, size uint32, e error) { ret, err := Assign(master, 1, replication, collection) if err != nil { return "", 0, err |
