| 
									
										
										
										
											2021-04-19 03:41:13 +08:00
										 |  |  | // Copyright (c) 2015-2021 MinIO, Inc.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This file is part of MinIO Object Storage stack
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is free software: you can redistribute it and/or modify
 | 
					
						
							|  |  |  | // it under the terms of the GNU Affero General Public License as published by
 | 
					
						
							|  |  |  | // the Free Software Foundation, either version 3 of the License, or
 | 
					
						
							|  |  |  | // (at your option) any later version.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					
						
							|  |  |  | // GNU Affero General Public License for more details.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU Affero General Public License
 | 
					
						
							|  |  |  | // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							| 
									
										
										
										
											2015-06-26 17:10:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-19 07:23:42 +08:00
										 |  |  | package cmd | 
					
						
							| 
									
										
										
										
											2015-06-26 17:10:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-16 09:45:57 +08:00
										 |  |  | import ( | 
					
						
							| 
									
										
										
										
											2018-02-24 07:07:21 +08:00
										 |  |  | 	"io" | 
					
						
							| 
									
										
										
										
											2020-03-19 07:19:29 +08:00
										 |  |  | 	"math" | 
					
						
							| 
									
										
										
										
											2018-02-16 09:45:57 +08:00
										 |  |  | 	"time" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 	"github.com/dustin/go-humanize" | 
					
						
							| 
									
										
										
										
											2022-12-07 05:46:50 +08:00
										 |  |  | 	"github.com/minio/madmin-go/v2" | 
					
						
							| 
									
										
										
										
											2021-06-02 05:59:40 +08:00
										 |  |  | 	"github.com/minio/minio/internal/bucket/replication" | 
					
						
							|  |  |  | 	"github.com/minio/minio/internal/hash" | 
					
						
							| 
									
										
										
										
											2022-12-08 06:56:07 +08:00
										 |  |  | 	"github.com/minio/minio/internal/logger" | 
					
						
							| 
									
										
										
										
											2018-02-16 09:45:57 +08:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2015-07-04 12:02:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-06 03:48:07 +08:00
										 |  |  | // BackendType - represents different backend types.
 | 
					
						
							|  |  |  | type BackendType int | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Enum for different backend types.
 | 
					
						
							|  |  |  | const ( | 
					
						
							| 
									
										
										
										
											2021-03-05 06:36:23 +08:00
										 |  |  | 	Unknown = BackendType(madmin.Unknown) | 
					
						
							| 
									
										
										
										
											2016-10-06 03:48:07 +08:00
										 |  |  | 	// Filesystem backend.
 | 
					
						
							| 
									
										
										
										
											2021-03-05 06:36:23 +08:00
										 |  |  | 	BackendFS = BackendType(madmin.FS) | 
					
						
							| 
									
										
										
										
											2018-08-24 14:35:37 +08:00
										 |  |  | 	// Multi disk BackendErasure (single, distributed) backend.
 | 
					
						
							| 
									
										
										
										
											2021-03-05 06:36:23 +08:00
										 |  |  | 	BackendErasure = BackendType(madmin.Erasure) | 
					
						
							| 
									
										
										
										
											2016-10-06 03:48:07 +08:00
										 |  |  | 	// Add your own backend.
 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-22 01:35:19 +08:00
										 |  |  | // StorageInfo - represents total capacity of underlying storage.
 | 
					
						
							| 
									
										
										
										
											2021-03-05 06:36:23 +08:00
										 |  |  | type StorageInfo = madmin.StorageInfo | 
					
						
							| 
									
										
										
										
											2016-05-27 05:13:10 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 22:02:37 +08:00
										 |  |  | // objectHistogramInterval is an interval that will be
 | 
					
						
							|  |  |  | // used to report the histogram of objects data sizes
 | 
					
						
							|  |  |  | type objectHistogramInterval struct { | 
					
						
							|  |  |  | 	name       string | 
					
						
							|  |  |  | 	start, end int64 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-19 07:19:29 +08:00
										 |  |  | const ( | 
					
						
							|  |  |  | 	// dataUsageBucketLen must be length of ObjectsHistogramIntervals
 | 
					
						
							| 
									
										
										
										
											2023-03-11 00:53:59 +08:00
										 |  |  | 	dataUsageBucketLen  = 7 | 
					
						
							|  |  |  | 	dataUsageVersionLen = 7 | 
					
						
							| 
									
										
										
										
											2020-03-19 07:19:29 +08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-12 22:02:37 +08:00
										 |  |  | // ObjectsHistogramIntervals is the list of all intervals
 | 
					
						
							|  |  |  | // of object sizes to be included in objects histogram.
 | 
					
						
							| 
									
										
										
										
											2023-03-11 00:53:59 +08:00
										 |  |  | var ObjectsHistogramIntervals = [dataUsageBucketLen]objectHistogramInterval{ | 
					
						
							| 
									
										
										
										
											2020-05-27 21:45:43 +08:00
										 |  |  | 	{"LESS_THAN_1024_B", 0, humanize.KiByte - 1}, | 
					
						
							|  |  |  | 	{"BETWEEN_1024_B_AND_1_MB", humanize.KiByte, humanize.MiByte - 1}, | 
					
						
							|  |  |  | 	{"BETWEEN_1_MB_AND_10_MB", humanize.MiByte, humanize.MiByte*10 - 1}, | 
					
						
							|  |  |  | 	{"BETWEEN_10_MB_AND_64_MB", humanize.MiByte * 10, humanize.MiByte*64 - 1}, | 
					
						
							|  |  |  | 	{"BETWEEN_64_MB_AND_128_MB", humanize.MiByte * 64, humanize.MiByte*128 - 1}, | 
					
						
							|  |  |  | 	{"BETWEEN_128_MB_AND_512_MB", humanize.MiByte * 128, humanize.MiByte*512 - 1}, | 
					
						
							|  |  |  | 	{"GREATER_THAN_512_MB", humanize.MiByte * 512, math.MaxInt64}, | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 00:53:59 +08:00
										 |  |  | // ObjectsVersionCountIntervals is the list of all intervals
 | 
					
						
							|  |  |  | // of object version count to be included in objects histogram.
 | 
					
						
							|  |  |  | var ObjectsVersionCountIntervals = [dataUsageVersionLen]objectHistogramInterval{ | 
					
						
							|  |  |  | 	{"UNVERSIONED", 0, 0}, | 
					
						
							|  |  |  | 	{"SINGLE_VERSION", 1, 1}, | 
					
						
							|  |  |  | 	{"BETWEEN_2_AND_10", 2, 9}, | 
					
						
							|  |  |  | 	{"BETWEEN_10_AND_100", 10, 99}, | 
					
						
							|  |  |  | 	{"BETWEEN_100_AND_1000", 100, 999}, | 
					
						
							|  |  |  | 	{"BETWEEN_1000_AND_10000", 1000, 9999}, | 
					
						
							|  |  |  | 	{"GREATER_THAN_10000", 10000, math.MaxInt64}, | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // BucketInfo - represents bucket metadata.
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | type BucketInfo struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the bucket.
 | 
					
						
							|  |  |  | 	Name string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Date and time when the bucket was created.
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | 	Created time.Time | 
					
						
							| 
									
										
										
										
											2022-07-26 08:51:32 +08:00
										 |  |  | 	Deleted time.Time | 
					
						
							| 
									
										
										
										
											2022-10-16 02:58:31 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Bucket features enabled
 | 
					
						
							|  |  |  | 	Versioning, ObjectLocking bool | 
					
						
							| 
									
										
										
										
											2017-01-18 02:02:58 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // ObjectInfo - represents object metadata.
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | type ObjectInfo struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the bucket.
 | 
					
						
							|  |  |  | 	Bucket string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the object.
 | 
					
						
							|  |  |  | 	Name string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Date and time when the object was last modified.
 | 
					
						
							|  |  |  | 	ModTime time.Time | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Total object size.
 | 
					
						
							|  |  |  | 	Size int64 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// IsDir indicates if the object is prefix.
 | 
					
						
							|  |  |  | 	IsDir bool | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-15 03:05:51 +08:00
										 |  |  | 	// Hex encoded unique entity tag of the object.
 | 
					
						
							|  |  |  | 	ETag string | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | 	// Version ID of this object.
 | 
					
						
							|  |  |  | 	VersionID string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// IsLatest indicates if this is the latest current version
 | 
					
						
							|  |  |  | 	// latest can be true for delete marker or a version.
 | 
					
						
							|  |  |  | 	IsLatest bool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// DeleteMarker indicates if the versionId corresponds
 | 
					
						
							|  |  |  | 	// to a delete marker on an object.
 | 
					
						
							|  |  |  | 	DeleteMarker bool | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-17 22:50:00 +08:00
										 |  |  | 	// Transitioned object information
 | 
					
						
							|  |  |  | 	TransitionedObject TransitionedObject | 
					
						
							| 
									
										
										
										
											2020-11-13 04:12:09 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// RestoreExpires indicates date a restored object expires
 | 
					
						
							|  |  |  | 	RestoreExpires time.Time | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// RestoreOngoing indicates if a restore is in progress
 | 
					
						
							|  |  |  | 	RestoreOngoing bool | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// A standard MIME type describing the format of the object.
 | 
					
						
							|  |  |  | 	ContentType string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Specifies what content encodings have been applied to the object and thus
 | 
					
						
							|  |  |  | 	// what decoding mechanisms must be applied to obtain the object referenced
 | 
					
						
							|  |  |  | 	// by the Content-Type header field.
 | 
					
						
							| 
									
										
										
										
											2016-05-20 08:10:08 +08:00
										 |  |  | 	ContentEncoding string | 
					
						
							| 
									
										
										
										
											2016-07-13 03:45:17 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-01 03:01:25 +08:00
										 |  |  | 	// Date and time at which the object is no longer able to be cached
 | 
					
						
							|  |  |  | 	Expires time.Time | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-11 12:21:13 +08:00
										 |  |  | 	// CacheStatus sets status of whether this is a cache hit/miss
 | 
					
						
							|  |  |  | 	CacheStatus CacheStatusType | 
					
						
							|  |  |  | 	// CacheLookupStatus sets whether a cacheable response is present in the cache
 | 
					
						
							|  |  |  | 	CacheLookupStatus CacheStatusType | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-06 01:56:28 +08:00
										 |  |  | 	// Specify object storage class
 | 
					
						
							|  |  |  | 	StorageClass string | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-19 04:31:35 +08:00
										 |  |  | 	ReplicationStatusInternal string | 
					
						
							|  |  |  | 	ReplicationStatus         replication.StatusType | 
					
						
							| 
									
										
										
										
											2016-07-13 03:45:17 +08:00
										 |  |  | 	// User-Defined metadata
 | 
					
						
							| 
									
										
										
										
											2018-01-23 06:54:55 +08:00
										 |  |  | 	UserDefined map[string]string | 
					
						
							| 
									
										
										
										
											2018-02-24 07:07:21 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-21 00:45:59 +08:00
										 |  |  | 	// User-Defined object tags
 | 
					
						
							|  |  |  | 	UserTags string | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-02 03:37:57 +08:00
										 |  |  | 	// List of individual parts, maximum size of upto 10,000
 | 
					
						
							| 
									
										
										
										
											2019-01-06 06:16:43 +08:00
										 |  |  | 	Parts []ObjectPartInfo `json:"-"` | 
					
						
							| 
									
										
										
										
											2018-03-02 03:37:57 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-24 07:07:21 +08:00
										 |  |  | 	// Implements writer and reader used by CopyObject API
 | 
					
						
							|  |  |  | 	Writer       io.WriteCloser `json:"-"` | 
					
						
							|  |  |  | 	Reader       *hash.Reader   `json:"-"` | 
					
						
							| 
									
										
										
										
											2018-11-15 09:36:41 +08:00
										 |  |  | 	PutObjReader *PutObjReader  `json:"-"` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-24 07:07:21 +08:00
										 |  |  | 	metadataOnly bool | 
					
						
							| 
									
										
										
										
											2020-08-04 07:21:10 +08:00
										 |  |  | 	versionOnly  bool // adds a new version, only used by CopyObject
 | 
					
						
							| 
									
										
										
										
											2020-05-29 03:36:20 +08:00
										 |  |  | 	keyRotation  bool | 
					
						
							| 
									
										
										
										
											2018-10-16 02:07:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-29 05:14:06 +08:00
										 |  |  | 	// Date and time when the object was last accessed.
 | 
					
						
							|  |  |  | 	AccTime time.Time | 
					
						
							| 
									
										
										
										
											2018-10-16 02:07:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-04 07:21:10 +08:00
										 |  |  | 	Legacy bool // indicates object on disk is in legacy data format
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-16 02:07:36 +08:00
										 |  |  | 	// backendType indicates which backend filled this structure
 | 
					
						
							| 
									
										
										
										
											2021-01-27 05:21:51 +08:00
										 |  |  | 	backendType BackendType | 
					
						
							| 
									
										
										
										
											2021-09-19 04:31:35 +08:00
										 |  |  | 	// internal representation of version purge status
 | 
					
						
							|  |  |  | 	VersionPurgeStatusInternal string | 
					
						
							|  |  |  | 	VersionPurgeStatus         VersionPurgeStatusType | 
					
						
							| 
									
										
										
										
											2021-02-02 01:52:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// The total count of all versions of this object
 | 
					
						
							|  |  |  | 	NumVersions int | 
					
						
							|  |  |  | 	//  The modtime of the successor object version if any
 | 
					
						
							|  |  |  | 	SuccessorModTime time.Time | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-31 23:13:23 +08:00
										 |  |  | 	// Checksums added on upload.
 | 
					
						
							|  |  |  | 	// Encoded, maybe encrypted.
 | 
					
						
							|  |  |  | 	Checksum []byte | 
					
						
							| 
									
										
										
										
											2023-04-18 03:16:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Inlined
 | 
					
						
							|  |  |  | 	Inlined bool | 
					
						
							| 
									
										
										
										
											2015-07-04 12:02:31 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-08 06:56:07 +08:00
										 |  |  | // ArchiveInfo returns any saved zip archive meta information.
 | 
					
						
							|  |  |  | // It will be decrypted if needed.
 | 
					
						
							|  |  |  | func (o *ObjectInfo) ArchiveInfo() []byte { | 
					
						
							| 
									
										
										
										
											2022-06-22 05:11:12 +08:00
										 |  |  | 	if len(o.UserDefined) == 0 { | 
					
						
							|  |  |  | 		return nil | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	z, ok := o.UserDefined[archiveInfoMetadataKey] | 
					
						
							|  |  |  | 	if !ok { | 
					
						
							|  |  |  | 		return nil | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2022-12-08 06:56:07 +08:00
										 |  |  | 	data := []byte(z) | 
					
						
							|  |  |  | 	if v, ok := o.UserDefined[archiveTypeMetadataKey]; ok && v == archiveTypeEnc { | 
					
						
							|  |  |  | 		decrypted, err := o.metadataDecrypter()(archiveTypeEnc, data) | 
					
						
							|  |  |  | 		if err != nil { | 
					
						
							|  |  |  | 			logger.LogIf(GlobalContext, err) | 
					
						
							|  |  |  | 			return nil | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		data = decrypted | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return data | 
					
						
							| 
									
										
										
										
											2022-06-22 05:11:12 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-04 12:41:33 +08:00
										 |  |  | // Clone - Returns a cloned copy of current objectInfo
 | 
					
						
							| 
									
										
										
										
											2022-12-08 06:56:07 +08:00
										 |  |  | func (o *ObjectInfo) Clone() (cinfo ObjectInfo) { | 
					
						
							| 
									
										
										
										
											2021-02-04 12:41:33 +08:00
										 |  |  | 	cinfo = ObjectInfo{ | 
					
						
							| 
									
										
										
										
											2021-09-19 04:31:35 +08:00
										 |  |  | 		Bucket:                     o.Bucket, | 
					
						
							|  |  |  | 		Name:                       o.Name, | 
					
						
							|  |  |  | 		ModTime:                    o.ModTime, | 
					
						
							|  |  |  | 		Size:                       o.Size, | 
					
						
							|  |  |  | 		IsDir:                      o.IsDir, | 
					
						
							|  |  |  | 		ETag:                       o.ETag, | 
					
						
							|  |  |  | 		VersionID:                  o.VersionID, | 
					
						
							|  |  |  | 		IsLatest:                   o.IsLatest, | 
					
						
							|  |  |  | 		DeleteMarker:               o.DeleteMarker, | 
					
						
							|  |  |  | 		TransitionedObject:         o.TransitionedObject, | 
					
						
							|  |  |  | 		RestoreExpires:             o.RestoreExpires, | 
					
						
							|  |  |  | 		RestoreOngoing:             o.RestoreOngoing, | 
					
						
							|  |  |  | 		ContentType:                o.ContentType, | 
					
						
							|  |  |  | 		ContentEncoding:            o.ContentEncoding, | 
					
						
							|  |  |  | 		Expires:                    o.Expires, | 
					
						
							|  |  |  | 		CacheStatus:                o.CacheStatus, | 
					
						
							|  |  |  | 		CacheLookupStatus:          o.CacheLookupStatus, | 
					
						
							|  |  |  | 		StorageClass:               o.StorageClass, | 
					
						
							|  |  |  | 		ReplicationStatus:          o.ReplicationStatus, | 
					
						
							|  |  |  | 		UserTags:                   o.UserTags, | 
					
						
							|  |  |  | 		Parts:                      o.Parts, | 
					
						
							|  |  |  | 		Writer:                     o.Writer, | 
					
						
							|  |  |  | 		Reader:                     o.Reader, | 
					
						
							|  |  |  | 		PutObjReader:               o.PutObjReader, | 
					
						
							|  |  |  | 		metadataOnly:               o.metadataOnly, | 
					
						
							|  |  |  | 		versionOnly:                o.versionOnly, | 
					
						
							|  |  |  | 		keyRotation:                o.keyRotation, | 
					
						
							|  |  |  | 		backendType:                o.backendType, | 
					
						
							|  |  |  | 		AccTime:                    o.AccTime, | 
					
						
							|  |  |  | 		Legacy:                     o.Legacy, | 
					
						
							|  |  |  | 		VersionPurgeStatus:         o.VersionPurgeStatus, | 
					
						
							|  |  |  | 		NumVersions:                o.NumVersions, | 
					
						
							|  |  |  | 		SuccessorModTime:           o.SuccessorModTime, | 
					
						
							|  |  |  | 		ReplicationStatusInternal:  o.ReplicationStatusInternal, | 
					
						
							|  |  |  | 		VersionPurgeStatusInternal: o.VersionPurgeStatusInternal, | 
					
						
							| 
									
										
										
										
											2021-02-04 12:41:33 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	cinfo.UserDefined = make(map[string]string, len(o.UserDefined)) | 
					
						
							|  |  |  | 	for k, v := range o.UserDefined { | 
					
						
							|  |  |  | 		cinfo.UserDefined[k] = v | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return cinfo | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-24 09:38:33 +08:00
										 |  |  | func (o ObjectInfo) tierStats() tierStats { | 
					
						
							|  |  |  | 	ts := tierStats{ | 
					
						
							|  |  |  | 		TotalSize:   uint64(o.Size), | 
					
						
							|  |  |  | 		NumVersions: 1, | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	// the current version of an object is accounted towards objects count
 | 
					
						
							|  |  |  | 	if o.IsLatest { | 
					
						
							|  |  |  | 		ts.NumObjects = 1 | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return ts | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-16 07:32:00 +08:00
										 |  |  | // ReplicateObjectInfo represents object info to be replicated
 | 
					
						
							|  |  |  | type ReplicateObjectInfo struct { | 
					
						
							|  |  |  | 	ObjectInfo | 
					
						
							| 
									
										
										
										
											2022-07-22 02:05:44 +08:00
										 |  |  | 	OpType               replication.Type | 
					
						
							|  |  |  | 	EventType            string | 
					
						
							|  |  |  | 	RetryCount           uint32 | 
					
						
							|  |  |  | 	ResetID              string | 
					
						
							|  |  |  | 	Dsc                  ReplicateDecision | 
					
						
							|  |  |  | 	ExistingObjResync    ResyncDecision | 
					
						
							|  |  |  | 	TargetArn            string | 
					
						
							|  |  |  | 	TargetStatuses       map[string]replication.StatusType | 
					
						
							|  |  |  | 	TargetPurgeStatuses  map[string]VersionPurgeStatusType | 
					
						
							|  |  |  | 	ReplicationTimestamp time.Time | 
					
						
							| 
									
										
										
										
											2021-04-16 07:32:00 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-29 03:36:20 +08:00
										 |  |  | // MultipartInfo captures metadata information about the uploadId
 | 
					
						
							|  |  |  | // this data structure is used primarily for some internal purposes
 | 
					
						
							|  |  |  | // for verifying upload type such as was the upload
 | 
					
						
							|  |  |  | // - encrypted
 | 
					
						
							|  |  |  | // - compressed
 | 
					
						
							|  |  |  | type MultipartInfo struct { | 
					
						
							|  |  |  | 	// Name of the bucket.
 | 
					
						
							|  |  |  | 	Bucket string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the object.
 | 
					
						
							|  |  |  | 	Object string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Upload ID identifying the multipart upload whose parts are being listed.
 | 
					
						
							|  |  |  | 	UploadID string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Date and time at which the multipart upload was initiated.
 | 
					
						
							|  |  |  | 	Initiated time.Time | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Any metadata set during InitMultipartUpload, including encryption headers.
 | 
					
						
							|  |  |  | 	UserDefined map[string]string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // ListPartsInfo - represents list of all parts.
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | type ListPartsInfo struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Name of the bucket.
 | 
					
						
							|  |  |  | 	Bucket string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the object.
 | 
					
						
							|  |  |  | 	Object string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Upload ID identifying the multipart upload whose parts are being listed.
 | 
					
						
							|  |  |  | 	UploadID string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// The class of storage used to store the object.
 | 
					
						
							|  |  |  | 	StorageClass string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Part number after which listing begins.
 | 
					
						
							|  |  |  | 	PartNumberMarker int | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// When a list is truncated, this element specifies the last part in the list,
 | 
					
						
							|  |  |  | 	// as well as the value to use for the part-number-marker request parameter
 | 
					
						
							|  |  |  | 	// in a subsequent request.
 | 
					
						
							| 
									
										
										
										
											2015-07-04 12:02:31 +08:00
										 |  |  | 	NextPartNumberMarker int | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Maximum number of parts that were allowed in the response.
 | 
					
						
							|  |  |  | 	MaxParts int | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Indicates whether the returned list of parts is truncated.
 | 
					
						
							|  |  |  | 	IsTruncated bool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of all parts.
 | 
					
						
							| 
									
										
										
										
											2017-02-01 01:38:34 +08:00
										 |  |  | 	Parts []PartInfo | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-02 03:37:57 +08:00
										 |  |  | 	// Any metadata set during InitMultipartUpload, including encryption headers.
 | 
					
						
							|  |  |  | 	UserDefined map[string]string | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// ChecksumAlgorithm if set
 | 
					
						
							|  |  |  | 	ChecksumAlgorithm string | 
					
						
							| 
									
										
										
										
											2015-07-04 12:02:31 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-20 09:42:27 +08:00
										 |  |  | // Lookup - returns if uploadID is valid
 | 
					
						
							|  |  |  | func (lm ListMultipartsInfo) Lookup(uploadID string) bool { | 
					
						
							|  |  |  | 	for _, upload := range lm.Uploads { | 
					
						
							|  |  |  | 		if upload.UploadID == uploadID { | 
					
						
							|  |  |  | 			return true | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return false | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | // ListMultipartsInfo - represnets bucket resources for incomplete multipart uploads.
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | type ListMultipartsInfo struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Together with upload-id-marker, this parameter specifies the multipart upload
 | 
					
						
							|  |  |  | 	// after which listing should begin.
 | 
					
						
							|  |  |  | 	KeyMarker string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Together with key-marker, specifies the multipart upload after which listing
 | 
					
						
							|  |  |  | 	// should begin. If key-marker is not specified, the upload-id-marker parameter
 | 
					
						
							|  |  |  | 	// is ignored.
 | 
					
						
							|  |  |  | 	UploadIDMarker string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// When a list is truncated, this element specifies the value that should be
 | 
					
						
							|  |  |  | 	// used for the key-marker request parameter in a subsequent request.
 | 
					
						
							|  |  |  | 	NextKeyMarker string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// When a list is truncated, this element specifies the value that should be
 | 
					
						
							|  |  |  | 	// used for the upload-id-marker request parameter in a subsequent request.
 | 
					
						
							| 
									
										
										
										
											2015-07-04 12:02:31 +08:00
										 |  |  | 	NextUploadIDMarker string | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Maximum number of multipart uploads that could have been included in the
 | 
					
						
							|  |  |  | 	// response.
 | 
					
						
							|  |  |  | 	MaxUploads int | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Indicates whether the returned list of multipart uploads is truncated. A
 | 
					
						
							|  |  |  | 	// value of true indicates that the list was truncated. The list can be truncated
 | 
					
						
							|  |  |  | 	// if the number of multipart uploads exceeds the limit allowed or specified
 | 
					
						
							|  |  |  | 	// by max uploads.
 | 
					
						
							|  |  |  | 	IsTruncated bool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of all pending uploads.
 | 
					
						
							| 
									
										
										
										
											2017-11-14 16:25:10 +08:00
										 |  |  | 	Uploads []MultipartInfo | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// When a prefix is provided in the request, The result contains only keys
 | 
					
						
							|  |  |  | 	// starting with the specified prefix.
 | 
					
						
							|  |  |  | 	Prefix string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// A character used to truncate the object prefixes.
 | 
					
						
							|  |  |  | 	// NOTE: only supported delimiter is '/'.
 | 
					
						
							|  |  |  | 	Delimiter string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// CommonPrefixes contains all (if there are any) keys between Prefix and the
 | 
					
						
							|  |  |  | 	// next occurrence of the string specified by delimiter.
 | 
					
						
							|  |  |  | 	CommonPrefixes []string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	EncodingType string // Not supported yet.
 | 
					
						
							| 
									
										
										
										
											2015-07-04 12:02:31 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-17 22:50:00 +08:00
										 |  |  | // TransitionedObject transitioned object tier and status.
 | 
					
						
							|  |  |  | type TransitionedObject struct { | 
					
						
							|  |  |  | 	Name        string | 
					
						
							|  |  |  | 	VersionID   string | 
					
						
							|  |  |  | 	Tier        string | 
					
						
							|  |  |  | 	FreeVersion bool | 
					
						
							|  |  |  | 	Status      string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | // DeletedObjectInfo - container for list objects versions deleted objects.
 | 
					
						
							|  |  |  | type DeletedObjectInfo struct { | 
					
						
							|  |  |  | 	// Name of the bucket.
 | 
					
						
							|  |  |  | 	Bucket string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Name of the object.
 | 
					
						
							|  |  |  | 	Name string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Date and time when the object was last modified.
 | 
					
						
							|  |  |  | 	ModTime time.Time | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Version ID of this object.
 | 
					
						
							|  |  |  | 	VersionID string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Indicates the deleted marker is latest
 | 
					
						
							|  |  |  | 	IsLatest bool | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // ListObjectVersionsInfo - container for list objects versions.
 | 
					
						
							|  |  |  | type ListObjectVersionsInfo struct { | 
					
						
							|  |  |  | 	// Indicates whether the returned list objects response is truncated. A
 | 
					
						
							|  |  |  | 	// value of true indicates that the list was truncated. The list can be truncated
 | 
					
						
							|  |  |  | 	// if the number of objects exceeds the limit allowed or specified
 | 
					
						
							|  |  |  | 	// by max keys.
 | 
					
						
							|  |  |  | 	IsTruncated bool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// When response is truncated (the IsTruncated element value in the response is true),
 | 
					
						
							|  |  |  | 	// you can use the key name in this field as marker in the subsequent
 | 
					
						
							|  |  |  | 	// request to get next set of objects.
 | 
					
						
							|  |  |  | 	//
 | 
					
						
							|  |  |  | 	// NOTE: AWS S3 returns NextMarker only if you have delimiter request parameter specified,
 | 
					
						
							|  |  |  | 	//       MinIO always returns NextMarker.
 | 
					
						
							|  |  |  | 	NextMarker string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// NextVersionIDMarker may be set of IsTruncated is true
 | 
					
						
							|  |  |  | 	NextVersionIDMarker string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of objects info for this request.
 | 
					
						
							|  |  |  | 	Objects []ObjectInfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of prefixes for this request.
 | 
					
						
							|  |  |  | 	Prefixes []string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | // ListObjectsInfo - container for list objects.
 | 
					
						
							|  |  |  | type ListObjectsInfo struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Indicates whether the returned list objects response is truncated. A
 | 
					
						
							|  |  |  | 	// value of true indicates that the list was truncated. The list can be truncated
 | 
					
						
							|  |  |  | 	// if the number of objects exceeds the limit allowed or specified
 | 
					
						
							|  |  |  | 	// by max keys.
 | 
					
						
							| 
									
										
										
										
											2016-01-20 09:49:48 +08:00
										 |  |  | 	IsTruncated bool | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-29 04:18:12 +08:00
										 |  |  | 	// When response is truncated (the IsTruncated element value in the response is true),
 | 
					
						
							|  |  |  | 	// you can use the key name in this field as marker in the subsequent
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// request to get next set of objects.
 | 
					
						
							|  |  |  | 	//
 | 
					
						
							| 
									
										
										
										
											2019-10-29 04:18:12 +08:00
										 |  |  | 	// NOTE: AWS S3 returns NextMarker only if you have delimiter request parameter specified,
 | 
					
						
							|  |  |  | 	//       MinIO always returns NextMarker.
 | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	NextMarker string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of objects info for this request.
 | 
					
						
							|  |  |  | 	Objects []ObjectInfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of prefixes for this request.
 | 
					
						
							|  |  |  | 	Prefixes []string | 
					
						
							| 
									
										
										
										
											2016-01-20 09:49:48 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-28 02:26:00 +08:00
										 |  |  | // ListObjectsV2Info - container for list objects version 2.
 | 
					
						
							|  |  |  | type ListObjectsV2Info struct { | 
					
						
							|  |  |  | 	// Indicates whether the returned list objects response is truncated. A
 | 
					
						
							|  |  |  | 	// value of true indicates that the list was truncated. The list can be truncated
 | 
					
						
							|  |  |  | 	// if the number of objects exceeds the limit allowed or specified
 | 
					
						
							|  |  |  | 	// by max keys.
 | 
					
						
							|  |  |  | 	IsTruncated bool | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// When response is truncated (the IsTruncated element value in the response
 | 
					
						
							|  |  |  | 	// is true), you can use the key name in this field as marker in the subsequent
 | 
					
						
							|  |  |  | 	// request to get next set of objects.
 | 
					
						
							|  |  |  | 	//
 | 
					
						
							|  |  |  | 	// NOTE: This element is returned only if you have delimiter request parameter
 | 
					
						
							|  |  |  | 	// specified.
 | 
					
						
							|  |  |  | 	ContinuationToken     string | 
					
						
							|  |  |  | 	NextContinuationToken string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of objects info for this request.
 | 
					
						
							|  |  |  | 	Objects []ObjectInfo | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// List of prefixes for this request.
 | 
					
						
							|  |  |  | 	Prefixes []string | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-01 01:38:34 +08:00
										 |  |  | // PartInfo - represents individual part metadata.
 | 
					
						
							|  |  |  | type PartInfo struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Part number that identifies the part. This is a positive integer between
 | 
					
						
							|  |  |  | 	// 1 and 10,000.
 | 
					
						
							|  |  |  | 	PartNumber int | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Date and time at which the part was uploaded.
 | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | 	LastModified time.Time | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Entity tag returned when the part was initially uploaded.
 | 
					
						
							|  |  |  | 	ETag string | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Size in bytes of the part.
 | 
					
						
							|  |  |  | 	Size int64 | 
					
						
							| 
									
										
										
										
											2018-09-28 11:36:17 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Decompressed Size.
 | 
					
						
							|  |  |  | 	ActualSize int64 | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Checksum values
 | 
					
						
							|  |  |  | 	ChecksumCRC32  string | 
					
						
							|  |  |  | 	ChecksumCRC32C string | 
					
						
							|  |  |  | 	ChecksumSHA1   string | 
					
						
							|  |  |  | 	ChecksumSHA256 string | 
					
						
							| 
									
										
										
											
												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)
```
											
										 
											2016-04-03 16:34:20 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-14 16:25:10 +08:00
										 |  |  | // CompletePart - represents the part that was completed, this is sent by the client
 | 
					
						
							|  |  |  | // during CompleteMultipartUpload request.
 | 
					
						
							|  |  |  | type CompletePart struct { | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 	// Part number identifying the part. This is a positive integer between 1 and
 | 
					
						
							|  |  |  | 	// 10,000
 | 
					
						
							| 
									
										
										
										
											2015-10-17 02:26:01 +08:00
										 |  |  | 	PartNumber int | 
					
						
							| 
									
										
										
										
											2016-06-09 21:24:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Entity tag returned when the part was uploaded.
 | 
					
						
							|  |  |  | 	ETag string | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Checksum values. Optional.
 | 
					
						
							|  |  |  | 	ChecksumCRC32  string | 
					
						
							|  |  |  | 	ChecksumCRC32C string | 
					
						
							|  |  |  | 	ChecksumSHA1   string | 
					
						
							|  |  |  | 	ChecksumSHA256 string | 
					
						
							| 
									
										
										
										
											2015-10-17 02:26:01 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-14 16:25:10 +08:00
										 |  |  | // CompleteMultipartUpload - represents list of parts which are completed, this is sent by the
 | 
					
						
							|  |  |  | // client during CompleteMultipartUpload request.
 | 
					
						
							|  |  |  | type CompleteMultipartUpload struct { | 
					
						
							|  |  |  | 	Parts []CompletePart `xml:"Part"` | 
					
						
							| 
									
										
										
										
											2015-10-17 02:26:01 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2022-08-30 07:57:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // NewMultipartUploadResult contains information about a newly created multipart upload.
 | 
					
						
							|  |  |  | type NewMultipartUploadResult struct { | 
					
						
							|  |  |  | 	UploadID     string | 
					
						
							|  |  |  | 	ChecksumAlgo string | 
					
						
							|  |  |  | } |