summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2023-07-21 14:22:17 +0000
committerLibravatar GitHub <noreply@github.com>2023-07-21 14:22:17 +0000
commit83139989b5b83eb85b8b1741f4d9206023b8cb0d (patch)
treee2aecd87eb8c7fec4650d872588ff9102594d0a2 /vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
parent[chore]: Bump github.com/go-playground/form/v4 from 4.2.0 to 4.2.1 (#1994) (diff)
downloadgotosocial-83139989b5b83eb85b8b1741f4d9206023b8cb0d.tar.xz
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.59 to 7.0.60 (#1992)
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go b/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
index 55b0d716f..830061b8e 100644
--- a/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
+++ b/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go
@@ -308,19 +308,27 @@ func (eDate ExpirationDate) MarshalXML(e *xml.Encoder, startElement xml.StartEle
}
// ExpireDeleteMarker represents value of ExpiredObjectDeleteMarker field in Expiration XML element.
-type ExpireDeleteMarker bool
+type ExpireDeleteMarker ExpirationBoolean
+
+// IsEnabled returns true if the auto delete-marker expiration is enabled
+func (e ExpireDeleteMarker) IsEnabled() bool {
+ return bool(e)
+}
+
+// ExpirationBoolean represents an XML version of 'bool' type
+type ExpirationBoolean bool
// MarshalXML encodes delete marker boolean into an XML form.
-func (b ExpireDeleteMarker) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error {
+func (b ExpirationBoolean) MarshalXML(e *xml.Encoder, startElement xml.StartElement) error {
if !b {
return nil
}
- type expireDeleteMarkerWrapper ExpireDeleteMarker
- return e.EncodeElement(expireDeleteMarkerWrapper(b), startElement)
+ type booleanWrapper ExpirationBoolean
+ return e.EncodeElement(booleanWrapper(b), startElement)
}
-// IsEnabled returns true if the auto delete-marker expiration is enabled
-func (b ExpireDeleteMarker) IsEnabled() bool {
+// IsEnabled returns true if the expiration boolean is enabled
+func (b ExpirationBoolean) IsEnabled() bool {
return bool(b)
}
@@ -330,6 +338,7 @@ type Expiration struct {
Date ExpirationDate `xml:"Date,omitempty" json:"Date,omitempty"`
Days ExpirationDays `xml:"Days,omitempty" json:"Days,omitempty"`
DeleteMarker ExpireDeleteMarker `xml:"ExpiredObjectDeleteMarker,omitempty" json:"ExpiredObjectDeleteMarker,omitempty"`
+ DeleteAll ExpirationBoolean `xml:"ExpiredObjectAllVersions,omitempty" json:"ExpiredObjectAllVersions,omitempty"`
}
// MarshalJSON customizes json encoding by removing empty day/date specification.
@@ -338,10 +347,12 @@ func (e Expiration) MarshalJSON() ([]byte, error) {
Date *ExpirationDate `json:"Date,omitempty"`
Days *ExpirationDays `json:"Days,omitempty"`
DeleteMarker ExpireDeleteMarker `json:"ExpiredObjectDeleteMarker,omitempty"`
+ DeleteAll ExpirationBoolean `json:"ExpiredObjectAllVersions,omitempty"`
}
newexp := expiration{
DeleteMarker: e.DeleteMarker,
+ DeleteAll: e.DeleteAll,
}
if !e.IsDaysNull() {
newexp.Days = &e.Days