mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
add bucket tagging support (#9389)
This patch also simplifies object tagging support
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user