Implement S3 Style ErrorCodes and Response

This patchset also brings in lot of cleanup in terms of minioapi codebase
This commit is contained in:
Harshavardhana
2015-02-11 03:23:15 -08:00
parent 6e73ccec75
commit ac4f07906c
7 changed files with 532 additions and 170 deletions

View File

@@ -21,6 +21,7 @@ import (
"crypto/sha256"
"fmt"
"io"
"log"
"sort"
"strings"
"time"
@@ -51,6 +52,7 @@ func (storage *storage) CopyObjectToWriter(w io.Writer, bucket string, object st
if val, ok := storage.objectdata[key]; ok {
objectBuffer := bytes.NewBuffer(val.data)
written, err := io.Copy(w, objectBuffer)
log.Println("I am here")
return written, err
} else {
return 0, mstorage.ObjectNotFound{Bucket: bucket, Object: object}