Implement bucket policy handler and with galore of cleanup

This commit is contained in:
Harshavardhana
2015-02-15 17:03:27 -08:00
parent 7d8c34e055
commit eeae64935e
18 changed files with 827 additions and 407 deletions

View File

@@ -30,6 +30,10 @@ type ObjectExists struct {
Key string
}
type ApiNotImplemented struct {
Api string
}
type ObjectNotFound GenericObjectError
type GenericBucketError struct {
@@ -68,15 +72,24 @@ func EmbedError(bucket, object string, err error) ImplementationError {
}
type BackendCorrupted BackendError
type BucketPolicyNotFound GenericBucketError
type BucketNameInvalid GenericBucketError
type BucketExists GenericBucketError
type BucketNotFound GenericBucketError
type ObjectNameInvalid GenericObjectError
func (self BucketPolicyNotFound) Error() string {
return "Bucket policy not found for: " + self.Bucket
}
func (self ObjectNotFound) Error() string {
return "Object not Found: " + self.Bucket + "#" + self.Object
}
func (self ApiNotImplemented) Error() string {
return "Api not implemented: " + self.Api
}
func (self ObjectExists) Error() string {
return "Object exists: " + self.Bucket + "#" + self.Key
}