mirror of
https://github.com/minio/minio.git
synced 2025-11-13 15:21:36 -05:00
objectAPI: Fix object API interface, remove unnecessary structs.
ObjectAPI changes. ``` ListObjects(bucket, prefix, marker, delimiter string, maxKeys int) (ListObjectsInfo, *probe.Error) ListMultipartUploads(bucket, objectPrefix, keyMarker, uploadIDMarker, delimiter string, maxUploads int) (ListMultipartsInfo, *probe.Error) ListObjectParts(bucket, object, uploadID string, partNumberMarker, maxParts int) (ListPartsInfo, *probe.Error) CompleteMultipartUpload(bucket string, object string, uploadID string, parts []completePart) (ObjectInfo, *probe.Error) ```
This commit is contained in:
@@ -139,12 +139,12 @@ func (web *webAPI) MakeBucket(r *http.Request, args *MakeBucketArgs, reply *Gene
|
||||
|
||||
// ListBucketsRep - list buckets response
|
||||
type ListBucketsRep struct {
|
||||
Buckets []BketInfo `json:"buckets"`
|
||||
UIVersion string `json:"uiVersion"`
|
||||
Buckets []WebBucketInfo `json:"buckets"`
|
||||
UIVersion string `json:"uiVersion"`
|
||||
}
|
||||
|
||||
// BketInfo container for list buckets.
|
||||
type BketInfo struct {
|
||||
// WebBucketInfo container for list buckets metadata.
|
||||
type WebBucketInfo struct {
|
||||
// The name of the bucket.
|
||||
Name string `json:"name"`
|
||||
// Date the bucket was created.
|
||||
@@ -163,7 +163,7 @@ func (web *webAPI) ListBuckets(r *http.Request, args *GenericArgs, reply *ListBu
|
||||
for _, bucket := range buckets {
|
||||
// List all buckets which are not private.
|
||||
if bucket.Name != path.Base(reservedBucket) {
|
||||
reply.Buckets = append(reply.Buckets, BketInfo{
|
||||
reply.Buckets = append(reply.Buckets, WebBucketInfo{
|
||||
Name: bucket.Name,
|
||||
CreationDate: bucket.Created,
|
||||
})
|
||||
@@ -181,12 +181,12 @@ type ListObjectsArgs struct {
|
||||
|
||||
// ListObjectsRep - list objects response.
|
||||
type ListObjectsRep struct {
|
||||
Objects []ObjInfo `json:"objects"`
|
||||
UIVersion string `json:"uiVersion"`
|
||||
Objects []WebObjectInfo `json:"objects"`
|
||||
UIVersion string `json:"uiVersion"`
|
||||
}
|
||||
|
||||
// ObjInfo container for list objects.
|
||||
type ObjInfo struct {
|
||||
// WebObjectInfo container for list objects metadata.
|
||||
type WebObjectInfo struct {
|
||||
// Name of the object
|
||||
Key string `json:"name"`
|
||||
// Date and time the object was last modified.
|
||||
@@ -210,14 +210,14 @@ func (web *webAPI) ListObjects(r *http.Request, args *ListObjectsArgs, reply *Li
|
||||
}
|
||||
marker = lo.NextMarker
|
||||
for _, obj := range lo.Objects {
|
||||
reply.Objects = append(reply.Objects, ObjInfo{
|
||||
reply.Objects = append(reply.Objects, WebObjectInfo{
|
||||
Key: obj.Name,
|
||||
LastModified: obj.ModifiedTime,
|
||||
Size: obj.Size,
|
||||
})
|
||||
}
|
||||
for _, prefix := range lo.Prefixes {
|
||||
reply.Objects = append(reply.Objects, ObjInfo{
|
||||
reply.Objects = append(reply.Objects, WebObjectInfo{
|
||||
Key: prefix,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user