mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
Golint cleanup pkg/storage
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user