Golint cleanup pkg/storage

This commit is contained in:
Harshavardhana
2015-03-05 20:32:04 -08:00
parent 256faddab5
commit 76e601b26b
7 changed files with 89 additions and 72 deletions
+8 -3
View File
@@ -23,6 +23,7 @@ import (
"unicode/utf8"
)
// Storage - generic API interface
type Storage interface {
// Bucket Operations
ListBuckets() ([]BucketMetadata, error)
@@ -37,11 +38,13 @@ type Storage interface {
StoreObject(bucket string, key string, contentType string, data io.Reader) error
}
// BucketMetadata - name and create date
type BucketMetadata struct {
Name string
Created time.Time
}
// ObjectMetadata - object key and its relevant metadata
type ObjectMetadata struct {
Bucket string
Key string
@@ -52,7 +55,7 @@ type ObjectMetadata struct {
Size int64
}
// Various types of bucket resources
// BucketResourcesMetadata - various types of bucket resources
type BucketResourcesMetadata struct {
Prefix string
Marker string
@@ -67,7 +70,8 @@ type BucketResourcesMetadata struct {
Notification string
}
// Verify Bucket name in accordance with http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html
// IsValidBucket - verify bucket name in accordance with
// - http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html
func IsValidBucket(bucket string) bool {
if len(bucket) < 3 || len(bucket) > 63 {
return false
@@ -83,7 +87,8 @@ func IsValidBucket(bucket string) bool {
return match
}
// Verify Object name in accordance with http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
// IsValidObject - verify object name in accordance with
// - http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html
func IsValidObject(object string) bool {
if len(object) > 1024 || len(object) == 0 {
return false