add bucket tagging support (#9389)

This patch also simplifies object tagging support
This commit is contained in:
Bala FA
2020-05-05 21:18:13 +00:00
committed by GitHub
parent 6c62b1a2ea
commit 3773874cd3
22 changed files with 188 additions and 426 deletions

View File

@@ -19,14 +19,14 @@ package lifecycle
import (
"encoding/xml"
"github.com/minio/minio/pkg/bucket/object/tagging"
"github.com/minio/minio-go/v6/pkg/tags"
)
// And - a tag to combine a prefix and multiple tags for lifecycle configuration rule.
type And struct {
XMLName xml.Name `xml:"And"`
Prefix string `xml:"Prefix,omitempty"`
Tags []tagging.Tag `xml:"Tag,omitempty"`
XMLName xml.Name `xml:"And"`
Prefix string `xml:"Prefix,omitempty"`
Tags []tags.Tag `xml:"Tag,omitempty"`
}
var errDuplicateTagKey = Errorf("Duplicate Tag Keys are not allowed")

View File

@@ -19,7 +19,7 @@ package lifecycle
import (
"encoding/xml"
"github.com/minio/minio/pkg/bucket/object/tagging"
"github.com/minio/minio-go/v6/pkg/tags"
)
var (
@@ -31,7 +31,7 @@ type Filter struct {
XMLName xml.Name `xml:"Filter"`
Prefix string
And And
Tag tagging.Tag
Tag tags.Tag
}
// MarshalXML - produces the xml representation of the Filter struct
@@ -89,5 +89,5 @@ func (f Filter) Validate() error {
// isEmpty - returns true if Filter tag is empty
func (f Filter) isEmpty() bool {
return f.And.isEmpty() && f.Prefix == "" && f.Tag == tagging.Tag{}
return f.And.isEmpty() && f.Prefix == "" && f.Tag.IsEmpty()
}