You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.0 KiB
67 lines
2.0 KiB
10 years ago
|
/*
|
||
9 years ago
|
* Minio Cloud Storage, (C) 2015 Minio, Inc.
|
||
10 years ago
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*/
|
||
|
|
||
9 years ago
|
package main
|
||
10 years ago
|
|
||
|
import (
|
||
|
"net/url"
|
||
|
"strconv"
|
||
|
|
||
10 years ago
|
"github.com/minio/minio/pkg/donut"
|
||
10 years ago
|
)
|
||
10 years ago
|
|
||
10 years ago
|
// parse bucket url queries
|
||
10 years ago
|
func getBucketResources(values url.Values) (v donut.BucketResourcesMetadata) {
|
||
10 years ago
|
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")
|
||
10 years ago
|
return
|
||
|
}
|
||
10 years ago
|
|
||
10 years ago
|
// part bucket url queries for ?uploads
|
||
10 years ago
|
func getBucketMultipartResources(values url.Values) (v donut.BucketMultipartResourcesMetadata) {
|
||
10 years ago
|
v.Prefix = values.Get("prefix")
|
||
|
v.KeyMarker = values.Get("key-marker")
|
||
|
v.MaxUploads, _ = strconv.Atoi(values.Get("max-uploads"))
|
||
|
v.Delimiter = values.Get("delimiter")
|
||
|
v.EncodingType = values.Get("encoding-type")
|
||
|
v.UploadIDMarker = values.Get("upload-id-marker")
|
||
|
return
|
||
|
}
|
||
|
|
||
10 years ago
|
// parse object url queries
|
||
10 years ago
|
func getObjectResources(values url.Values) (v donut.ObjectResourcesMetadata) {
|
||
10 years ago
|
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")
|
||
10 years ago
|
return
|
||
|
}
|
||
|
|
||
10 years ago
|
// check if req quere values carry uploads resource
|
||
|
func isRequestUploads(values url.Values) bool {
|
||
|
_, ok := values["uploads"]
|
||
|
return ok
|
||
|
}
|
||
|
|
||
|
// check if req query values carry acl resource
|
||
10 years ago
|
func isRequestBucketACL(values url.Values) bool {
|
||
10 years ago
|
_, ok := values["acl"]
|
||
|
return ok
|
||
10 years ago
|
}
|