From 930daa93d1d51bbe7730a097f3c5c2e67e8c8d29 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 26 Apr 2022 16:19:26 -0700 Subject: [PATCH] versioning: Add support for ExcludedPrefixes --- api-bucket-versioning.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api-bucket-versioning.go b/api-bucket-versioning.go index 930b1b93a..e7839dfdc 100644 --- a/api-bucket-versioning.go +++ b/api-bucket-versioning.go @@ -76,11 +76,19 @@ func (c *Client) SuspendVersioning(ctx context.Context, bucketName string) error return c.SetBucketVersioning(ctx, bucketName, BucketVersioningConfiguration{Status: "Suspended"}) } +// ExcludedPrefix - holds individual prefixes excluded from being versioned. +type ExcludedPrefix struct { + Prefix string +} + // BucketVersioningConfiguration is the versioning configuration structure type BucketVersioningConfiguration struct { XMLName xml.Name `xml:"VersioningConfiguration"` Status string `xml:"Status"` MFADelete string `xml:"MfaDelete,omitempty"` + // MinIO extension - allows selective, prefix-level versioning exclusion. + // Requires versioning to be enabled + ExcludedPrefixes []ExcludedPrefix `xml:",omitempty"` } // Various supported states