2021-04-18 15:41:13 -04: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/>.
|
2016-03-05 19:43:48 -05:00
|
|
|
|
2016-08-18 19:23:42 -04:00
|
|
|
package cmd
|
2016-03-05 19:43:48 -05:00
|
|
|
|
2016-04-20 20:35:38 -04:00
|
|
|
import (
|
|
|
|
"encoding/xml"
|
2020-11-19 21:43:58 -05:00
|
|
|
"time"
|
2016-04-20 20:35:38 -04:00
|
|
|
)
|
|
|
|
|
2020-06-12 23:04:01 -04:00
|
|
|
// DeletedObject objects deleted
|
|
|
|
type DeletedObject struct {
|
2020-07-10 11:30:23 -04:00
|
|
|
DeleteMarker bool `xml:"DeleteMarker,omitempty"`
|
2020-06-12 23:04:01 -04:00
|
|
|
DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"`
|
|
|
|
ObjectName string `xml:"Key,omitempty"`
|
|
|
|
VersionID string `xml:"VersionId,omitempty"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// MTime of DeleteMarker on source that needs to be propagated to replica
|
2021-09-18 16:31:35 -04:00
|
|
|
DeleteMarkerMTime DeleteMarkerMTime `xml:"-"`
|
|
|
|
// MinIO extensions to support delete marker replication
|
|
|
|
ReplicationState ReplicationState `xml:"-"`
|
2020-06-12 23:04:01 -04:00
|
|
|
}
|
|
|
|
|
2020-11-29 00:15:45 -05: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)
|
|
|
|
}
|
|
|
|
|
2022-01-03 04:28:52 -05:00
|
|
|
// ObjectV object version key/versionId
|
|
|
|
type ObjectV struct {
|
2016-03-05 19:43:48 -05:00
|
|
|
ObjectName string `xml:"Key"`
|
2020-06-12 23:04:01 -04:00
|
|
|
VersionID string `xml:"VersionId"`
|
2022-01-03 04:28:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// ObjectToDelete carries key name for the object to delete.
|
|
|
|
type ObjectToDelete struct {
|
|
|
|
ObjectV
|
2020-11-19 21:43:58 -05:00
|
|
|
// Replication status of DeleteMarker
|
2020-11-12 15:10:59 -05:00
|
|
|
DeleteMarkerReplicationStatus string `xml:"DeleteMarkerReplicationStatus"`
|
2020-11-19 21:43:58 -05:00
|
|
|
// Status of versioned delete (of object or DeleteMarker)
|
2020-11-12 15:10:59 -05:00
|
|
|
VersionPurgeStatus VersionPurgeStatusType `xml:"VersionPurgeStatus"`
|
2021-09-18 16:31:35 -04:00
|
|
|
// VersionPurgeStatuses holds the internal
|
|
|
|
VersionPurgeStatuses string `xml:"VersionPurgeStatuses"`
|
|
|
|
// ReplicateDecisionStr stringified representation of replication decision
|
|
|
|
ReplicateDecisionStr string `xml:"-"`
|
2016-03-05 19:43:48 -05:00
|
|
|
}
|
|
|
|
|
2016-04-20 20:35:38 -04:00
|
|
|
// createBucketConfiguration container for bucket configuration request from client.
|
2019-11-20 16:18:09 -05:00
|
|
|
// Used for parsing the location from the request body for Makebucket.
|
2016-04-20 20:35:38 -04:00
|
|
|
type createBucketLocationConfiguration struct {
|
2016-09-29 18:51:00 -04:00
|
|
|
XMLName xml.Name `xml:"CreateBucketConfiguration" json:"-"`
|
2016-04-20 20:35:38 -04:00
|
|
|
Location string `xml:"LocationConstraint"`
|
|
|
|
}
|
|
|
|
|
2016-03-05 19:43:48 -05: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-12 23:04:01 -04:00
|
|
|
Objects []ObjectToDelete `xml:"Object"`
|
2016-03-05 19:43:48 -05:00
|
|
|
}
|