simplify bucket metadata lookups for versioning/object locking (#17253)

This commit is contained in:
Harshavardhana
2023-05-22 12:05:14 -07:00
committed by GitHub
parent b1b00a5055
commit fc03be7891
5 changed files with 21 additions and 8 deletions

View File

@@ -229,6 +229,11 @@ type Config struct {
} `xml:"Rule,omitempty"`
}
// Enabled returns true if config.ObjectLockEnabled is set to Enabled
func (config *Config) Enabled() bool {
return config.ObjectLockEnabled == Enabled
}
// UnmarshalXML - decodes XML data.
func (config *Config) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
// Make subtype to avoid recursive UnmarshalXML().