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.
100 lines
2.2 KiB
100 lines
2.2 KiB
10 years ago
|
/*
|
||
|
* Mini Object Storage, (C) 2014 Minio, Inc.
|
||
|
*
|
||
|
* 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.
|
||
|
*/
|
||
|
|
||
10 years ago
|
package api
|
||
10 years ago
|
|
||
|
import (
|
||
|
"encoding/xml"
|
||
|
)
|
||
|
|
||
10 years ago
|
// Limit number of objects in a given response
|
||
10 years ago
|
const (
|
||
10 years ago
|
maxObjectList = 1000
|
||
10 years ago
|
)
|
||
|
|
||
10 years ago
|
// ObjectListResponse format
|
||
10 years ago
|
type ObjectListResponse struct {
|
||
10 years ago
|
XMLName xml.Name `xml:"ListBucketResult" json:"-"`
|
||
|
Name string
|
||
|
Prefix string
|
||
|
Marker string
|
||
|
MaxKeys int
|
||
|
Delimiter string
|
||
|
IsTruncated bool
|
||
10 years ago
|
Contents []*Item
|
||
|
CommonPrefixes []*Prefix
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
// BucketListResponse - bucket list response format
|
||
10 years ago
|
type BucketListResponse struct {
|
||
10 years ago
|
XMLName xml.Name `xml:"ListAllMyBucketsResult" json:"-"`
|
||
10 years ago
|
Owner Owner
|
||
10 years ago
|
Buckets struct {
|
||
|
Bucket []*Bucket
|
||
10 years ago
|
} // Buckets are nested
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
// Prefix - common prefix
|
||
10 years ago
|
type Prefix struct {
|
||
|
Prefix string
|
||
|
}
|
||
|
|
||
10 years ago
|
// Bucket - bucket item
|
||
10 years ago
|
type Bucket struct {
|
||
|
Name string
|
||
|
CreationDate string
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
// Item - object item
|
||
10 years ago
|
type Item struct {
|
||
10 years ago
|
Key string
|
||
|
LastModified string
|
||
|
ETag string
|
||
10 years ago
|
Size int64
|
||
10 years ago
|
StorageClass string
|
||
|
Owner Owner
|
||
|
}
|
||
|
|
||
10 years ago
|
// Owner - bucket owner/principal
|
||
10 years ago
|
type Owner struct {
|
||
|
ID string
|
||
|
DisplayName string
|
||
|
}
|
||
10 years ago
|
|
||
10 years ago
|
// List of not implemented bucket queries
|
||
10 years ago
|
var unimplementedBucketResourceNames = map[string]bool{
|
||
|
"acl": true,
|
||
10 years ago
|
"cors": true,
|
||
10 years ago
|
"lifecycle": true,
|
||
|
"location": true,
|
||
|
"logging": true,
|
||
|
"notification": true,
|
||
10 years ago
|
"tagging": true,
|
||
10 years ago
|
"versions": true,
|
||
|
"requestPayment": true,
|
||
|
"versioning": true,
|
||
|
"website": true,
|
||
|
"uploads": true,
|
||
|
}
|
||
|
|
||
10 years ago
|
// List of not implemented object queries
|
||
10 years ago
|
var unimplementedObjectResourceNames = map[string]bool{
|
||
|
"uploadId": true,
|
||
|
"acl": true,
|
||
|
"torrent": true,
|
||
|
"uploads": true,
|
||
|
}
|