|
|
|
@ -25,37 +25,20 @@ import ( |
|
|
|
|
|
|
|
|
|
// parse bucket url queries
|
|
|
|
|
func getBucketResources(values url.Values) (v drivers.BucketResourcesMetadata) { |
|
|
|
|
for key, value := range values { |
|
|
|
|
switch true { |
|
|
|
|
case key == "prefix": |
|
|
|
|
v.Prefix = value[0] |
|
|
|
|
case key == "marker": |
|
|
|
|
v.Marker = value[0] |
|
|
|
|
case key == "max-keys": |
|
|
|
|
v.Maxkeys, _ = strconv.Atoi(value[0]) |
|
|
|
|
case key == "delimiter": |
|
|
|
|
v.Delimiter = value[0] |
|
|
|
|
case key == "encoding-type": |
|
|
|
|
v.EncodingType = value[0] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
v.Prefix = values.Get("prefix") |
|
|
|
|
v.Marker = values.Get("marker") |
|
|
|
|
v.Maxkeys, _ = strconv.Atoi(values.Get("max-keys")) |
|
|
|
|
v.Delimiter = values.Get("delimiter") |
|
|
|
|
v.EncodingType = values.Get("encoding-type") |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// parse object url queries
|
|
|
|
|
func getObjectResources(values url.Values) (v drivers.ObjectResourcesMetadata) { |
|
|
|
|
for key, value := range values { |
|
|
|
|
switch true { |
|
|
|
|
case key == "uploadId": |
|
|
|
|
v.UploadID = value[0] |
|
|
|
|
case key == "part-number-marker": |
|
|
|
|
v.PartNumberMarker, _ = strconv.Atoi(value[0]) |
|
|
|
|
case key == "max-parts": |
|
|
|
|
v.MaxParts, _ = strconv.Atoi(value[0]) |
|
|
|
|
case key == "encoding-type": |
|
|
|
|
v.EncodingType = value[0] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
v.UploadID = values.Get("uploadId") |
|
|
|
|
v.PartNumberMarker, _ = strconv.Atoi(values.Get("part-number-marker")) |
|
|
|
|
v.MaxParts, _ = strconv.Atoi(values.Get("max-parts")) |
|
|
|
|
v.EncodingType = values.Get("encoding-type") |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|