diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-12-13 00:58:58 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-12-13 00:58:58 -0800 |
| commit | e9cd798bd372741753efcba2af594b00fe7b8437 (patch) | |
| tree | e291019e7394a874a292ee90c832a65745f57fd4 /weed/operation/submit.go | |
| parent | 16cd6fb27838db95054701f5567c93d51bf24d5f (diff) | |
| download | seaweedfs-e9cd798bd372741753efcba2af594b00fe7b8437.tar.xz seaweedfs-e9cd798bd372741753efcba2af594b00fe7b8437.zip | |
adding volume type
Diffstat (limited to 'weed/operation/submit.go')
| -rw-r--r-- | weed/operation/submit.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/operation/submit.go b/weed/operation/submit.go index 25843c892..70ab4194a 100644 --- a/weed/operation/submit.go +++ b/weed/operation/submit.go @@ -25,6 +25,7 @@ type FilePart struct { Collection string DataCenter string Ttl string + VolumeType string Server string //this comes from assign result Fid string //this comes from assign result, but customizable Fsync bool @@ -38,7 +39,7 @@ type SubmitResult struct { Error string `json:"error,omitempty"` } -func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart, replication string, collection string, dataCenter string, ttl string, maxMB int, usePublicUrl bool) ([]SubmitResult, error) { +func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart, replication string, collection string, dataCenter string, ttl string, volumeType string, maxMB int, usePublicUrl bool) ([]SubmitResult, error) { results := make([]SubmitResult, len(files)) for index, file := range files { results[index].FileName = file.FileName @@ -49,6 +50,7 @@ func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart Collection: collection, DataCenter: dataCenter, Ttl: ttl, + VolumeType: volumeType, } ret, err := Assign(master, grpcDialOption, ar) if err != nil { @@ -69,6 +71,8 @@ func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart file.Replication = replication file.Collection = collection file.DataCenter = dataCenter + file.Ttl = ttl + file.VolumeType = volumeType results[index].Size, err = file.Upload(maxMB, master, usePublicUrl, ret.Auth, grpcDialOption) if err != nil { results[index].Error = err.Error() @@ -142,6 +146,7 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt secur Replication: fi.Replication, Collection: fi.Collection, Ttl: fi.Ttl, + VolumeType: fi.VolumeType, } ret, err = Assign(master, grpcDialOption, ar) if err != nil { @@ -155,6 +160,7 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt secur Replication: fi.Replication, Collection: fi.Collection, Ttl: fi.Ttl, + VolumeType: fi.VolumeType, } ret, err = Assign(master, grpcDialOption, ar) if err != nil { |
