mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
feat: Add ListBucketsWithMetadata extension API (#13219)
This commit is contained in:
@@ -240,6 +240,16 @@ type CommonPrefix struct {
|
||||
type Bucket struct {
|
||||
Name string
|
||||
CreationDate string // time string of format "2006-01-02T15:04:05.000Z"
|
||||
|
||||
// Usage size of the bucket not reflective of
|
||||
// actual usage atomically, but an ever increasing
|
||||
// value.
|
||||
Usage *BucketUsageInfo `xml:"Usage,omitempty"`
|
||||
|
||||
// Provides information about various bucket features
|
||||
// enabled such as versioning, object locking, tagging
|
||||
// quota, replication config etc.
|
||||
Details *BucketDetailsInfo `xml:"Details,omitempty"`
|
||||
}
|
||||
|
||||
// ObjectVersion container for object version metadata
|
||||
@@ -263,7 +273,7 @@ func (o ObjectVersion) MarshalXML(e *xml.Encoder, start xml.StartElement) error
|
||||
return e.EncodeElement(objectVersionWrapper(o), start)
|
||||
}
|
||||
|
||||
// StringMap is a map[string]string.
|
||||
// StringMap is a map[string]string
|
||||
type StringMap map[string]string
|
||||
|
||||
// MarshalXML - StringMap marshals into XML.
|
||||
@@ -424,10 +434,12 @@ func generateListBucketsResponse(buckets []BucketInfo) ListBucketsResponse {
|
||||
}
|
||||
|
||||
for _, bucket := range buckets {
|
||||
var listbucket = Bucket{}
|
||||
listbucket.Name = bucket.Name
|
||||
listbucket.CreationDate = bucket.Created.UTC().Format(iso8601TimeFormat)
|
||||
listbuckets = append(listbuckets, listbucket)
|
||||
listbuckets = append(listbuckets, Bucket{
|
||||
Name: bucket.Name,
|
||||
CreationDate: bucket.Created.UTC().Format(iso8601TimeFormat),
|
||||
Usage: bucket.Usage,
|
||||
Details: bucket.Details,
|
||||
})
|
||||
}
|
||||
|
||||
data.Owner = owner
|
||||
|
||||
Reference in New Issue
Block a user