Add public data-types for easier external loading (#5170)

This change brings public data-types such that
we can ask projects to implement gateway projects
externally than maintaining in our repo.

All publicly exported structs are maintained in object-api-datatypes.go

completePart --> CompletePart
uploadMetadata --> MultipartInfo

All other exported errors are at object-api-errors.go
This commit is contained in:
Harshavardhana
2017-11-14 00:25:10 -08:00
committed by Nitish Tiwari
parent 7d3eaf79ff
commit a4d6195244
22 changed files with 164 additions and 162 deletions

View File

@@ -263,13 +263,13 @@ func (e IncompleteBody) Error() string {
// InvalidRange - invalid range typed error.
type InvalidRange struct {
offsetBegin int64
offsetEnd int64
resourceSize int64
OffsetBegin int64
OffsetEnd int64
ResourceSize int64
}
func (e InvalidRange) Error() string {
return fmt.Sprintf("The requested range \"bytes %d-%d/%d\" is not satisfiable.", e.offsetBegin, e.offsetEnd, e.resourceSize)
return fmt.Sprintf("The requested range \"bytes %d-%d/%d\" is not satisfiable.", e.OffsetBegin, e.OffsetEnd, e.ResourceSize)
}
// ObjectTooLarge error returned when the size of the object > max object size allowed (5G) per request.
@@ -375,7 +375,7 @@ func (e UnsupportedMetadata) Error() string {
return "Unsupported headers in Metadata"
}
// Check if error type is IncompleteBody.
// isErrIncompleteBody - Check if error type is IncompleteBody.
func isErrIncompleteBody(err error) bool {
err = errorCause(err)
switch err.(type) {
@@ -385,7 +385,7 @@ func isErrIncompleteBody(err error) bool {
return false
}
// Check if error type is BucketPolicyNotFound.
// isErrBucketPolicyNotFound - Check if error type is BucketPolicyNotFound.
func isErrBucketPolicyNotFound(err error) bool {
err = errorCause(err)
switch err.(type) {
@@ -395,7 +395,7 @@ func isErrBucketPolicyNotFound(err error) bool {
return false
}
// Check if error type is ObjectNotFound.
// isErrObjectNotFound - Check if error type is ObjectNotFound.
func isErrObjectNotFound(err error) bool {
err = errorCause(err)
switch err.(type) {