filer copy added uid/gid

This commit is contained in:
Chris Lu
2018-05-21 01:25:30 -07:00
parent f07482382b
commit 9dd228747c
10 changed files with 163 additions and 94 deletions

View File

@@ -17,7 +17,7 @@ type SubmitResult struct {
Error string `json:"error,omitempty"`
}
func RegisterFile(filer string, path string, fileId string, fileSize int64, secret security.Secret) error {
func RegisterFile(filer string, path string, fileId string, fileSize int64, uid, gid int, secret security.Secret) error {
// TODO: jwt need to be used
_ = security.GenJwt(secret, fileId)
@@ -25,6 +25,8 @@ func RegisterFile(filer string, path string, fileId string, fileSize int64, secr
values.Add("path", path)
values.Add("fileId", fileId)
values.Add("fileSize", strconv.FormatInt(fileSize, 10))
values.Add("uid", strconv.Itoa(uid))
values.Add("gid", strconv.Itoa(gid))
_, err := util.Post("http://"+filer+"/admin/register", values)
if err != nil {
return fmt.Errorf("Failed to register path %s on filer %s to file id %s : %v", path, filer, fileId, err)