From db249504802dd5af09ad9b5fdf974d5b5816a21a Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Fri, 6 May 2022 23:06:32 -0700 Subject: [PATCH] versioning: Add support for ExcludedPrefixes and ExcludeFolders (#1646) --- api-bucket-versioning.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api-bucket-versioning.go b/api-bucket-versioning.go index 930b1b93a..8c84e4f27 100644 --- a/api-bucket-versioning.go +++ b/api-bucket-versioning.go @@ -76,11 +76,20 @@ 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"` + ExcludeFolders bool `xml:",omitempty"` } // Various supported states