| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  | /* | 
					
						
							| 
									
										
										
										
											2019-04-10 02:39:42 +08:00
										 |  |  |  * MinIO Cloud Storage, (C) 2015, 2016 MinIO, Inc. | 
					
						
							| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-19 07:23:42 +08:00
										 |  |  | package cmd | 
					
						
							| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-21 08:35:38 +08:00
										 |  |  | import ( | 
					
						
							|  |  |  | 	"encoding/xml" | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	"time" | 
					
						
							| 
									
										
										
										
											2016-04-21 08:35:38 +08:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | // DeletedObject objects deleted
 | 
					
						
							|  |  |  | type DeletedObject struct { | 
					
						
							| 
									
										
										
										
											2020-07-10 23:30:23 +08:00
										 |  |  | 	DeleteMarker          bool   `xml:"DeleteMarker,omitempty"` | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | 	DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"` | 
					
						
							|  |  |  | 	ObjectName            string `xml:"Key,omitempty"` | 
					
						
							|  |  |  | 	VersionID             string `xml:"VersionId,omitempty"` | 
					
						
							| 
									
										
										
										
											2020-11-13 04:10:59 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// MinIO extensions to support delete marker replication
 | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	// Replication status of DeleteMarker
 | 
					
						
							| 
									
										
										
										
											2020-11-13 04:10:59 +08:00
										 |  |  | 	DeleteMarkerReplicationStatus string `xml:"DeleteMarkerReplicationStatus,omitempty"` | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	// MTime of DeleteMarker on source that needs to be propagated to replica
 | 
					
						
							| 
									
										
										
										
											2020-11-29 13:15:45 +08:00
										 |  |  | 	DeleteMarkerMTime DeleteMarkerMTime `xml:"DeleteMarkerMTime,omitempty"` | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	// Status of versioned delete (of object or DeleteMarker)
 | 
					
						
							| 
									
										
										
										
											2020-11-13 04:10:59 +08:00
										 |  |  | 	VersionPurgeStatus VersionPurgeStatusType `xml:"VersionPurgeStatus,omitempty"` | 
					
						
							| 
									
										
										
										
											2020-11-26 03:24:50 +08:00
										 |  |  | 	// PurgeTransitioned is nonempty if object is in transition tier
 | 
					
						
							|  |  |  | 	PurgeTransitioned string `xml:"PurgeTransitioned,omitempty"` | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-29 13:15:45 +08:00
										 |  |  | // DeleteMarkerMTime is an embedded type containing time.Time for XML marshal
 | 
					
						
							|  |  |  | type DeleteMarkerMTime struct { | 
					
						
							|  |  |  | 	time.Time | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // MarshalXML encodes expiration date if it is non-zero and encodes
 | 
					
						
							|  |  |  | // empty string otherwise
 | 
					
						
							|  |  |  | func (t DeleteMarkerMTime) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error { | 
					
						
							|  |  |  | 	if t.Time.IsZero() { | 
					
						
							|  |  |  | 		return nil | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return e.EncodeElement(t.Time.Format(time.RFC3339), startElement) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | // ObjectToDelete carries key name for the object to delete.
 | 
					
						
							|  |  |  | type ObjectToDelete struct { | 
					
						
							| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  | 	ObjectName string `xml:"Key"` | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | 	VersionID  string `xml:"VersionId"` | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	// Replication status of DeleteMarker
 | 
					
						
							| 
									
										
										
										
											2020-11-13 04:10:59 +08:00
										 |  |  | 	DeleteMarkerReplicationStatus string `xml:"DeleteMarkerReplicationStatus"` | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	// Status of versioned delete (of object or DeleteMarker)
 | 
					
						
							| 
									
										
										
										
											2020-11-13 04:10:59 +08:00
										 |  |  | 	VersionPurgeStatus VersionPurgeStatusType `xml:"VersionPurgeStatus"` | 
					
						
							| 
									
										
										
										
											2020-11-20 10:43:58 +08:00
										 |  |  | 	// Version ID of delete marker
 | 
					
						
							| 
									
										
										
										
											2020-11-13 04:10:59 +08:00
										 |  |  | 	DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId"` | 
					
						
							| 
									
										
										
										
											2020-11-26 03:24:50 +08:00
										 |  |  | 	// PurgeTransitioned is nonempty if object is in transition tier
 | 
					
						
							|  |  |  | 	PurgeTransitioned string `xml:"PurgeTransitioned"` | 
					
						
							| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-21 08:35:38 +08:00
										 |  |  | // createBucketConfiguration container for bucket configuration request from client.
 | 
					
						
							| 
									
										
										
										
											2019-11-21 05:18:09 +08:00
										 |  |  | // Used for parsing the location from the request body for Makebucket.
 | 
					
						
							| 
									
										
										
										
											2016-04-21 08:35:38 +08:00
										 |  |  | type createBucketLocationConfiguration struct { | 
					
						
							| 
									
										
										
										
											2016-09-30 06:51:00 +08:00
										 |  |  | 	XMLName  xml.Name `xml:"CreateBucketConfiguration" json:"-"` | 
					
						
							| 
									
										
										
										
											2016-04-21 08:35:38 +08:00
										 |  |  | 	Location string   `xml:"LocationConstraint"` | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  | // DeleteObjectsRequest - xml carrying the object key names which needs to be deleted.
 | 
					
						
							|  |  |  | type DeleteObjectsRequest struct { | 
					
						
							|  |  |  | 	// Element to enable quiet mode for the request
 | 
					
						
							|  |  |  | 	Quiet bool | 
					
						
							|  |  |  | 	// List of objects to be deleted
 | 
					
						
							| 
									
										
										
										
											2020-06-13 11:04:01 +08:00
										 |  |  | 	Objects []ObjectToDelete `xml:"Object"` | 
					
						
							| 
									
										
										
										
											2016-03-06 08:43:48 +08:00
										 |  |  | } |