Integrate cache with donut, add tests

This commit is contained in:
Harshavardhana
2015-07-01 18:09:44 -07:00
parent 0533abf6a8
commit bce93c1b3a
4 changed files with 146 additions and 203 deletions
+9 -1
View File
@@ -181,7 +181,7 @@ func IsValidBucket(bucket string) bool {
// - http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
func IsValidObjectName(object string) bool {
if strings.TrimSpace(object) == "" {
return true
return false
}
if len(object) > 1024 || len(object) == 0 {
return false
@@ -191,3 +191,11 @@ func IsValidObjectName(object string) bool {
}
return true
}
// IsValidPrefix - verify prefix name is correct, an empty prefix is valid
func IsValidPrefix(prefix string) bool {
if strings.TrimSpace(prefix) == "" {
return true
}
return IsValidObjectName(prefix)
}