add String function for needle to print

This commit is contained in:
yanyiwu 2014-12-26 13:29:44 +08:00
parent 2b1369277f
commit 089eb8ad39

View file

@ -3,6 +3,7 @@ package storage
import (
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"mime"
"net/http"
@ -45,6 +46,11 @@ type Needle struct {
Padding []byte `comment:"Aligned to 8 bytes"`
}
func (n *Needle) String() (str string) {
str = fmt.Sprintf("Cookie:%d, Id:%d, Size:%d, DataSize:%d, Name: %s, Mime: %s", n.Cookie, n.Id, n.Size, n.DataSize, n.Name, n.Mime)
return
}
func ParseUpload(r *http.Request) (fileName string, data []byte, mimeType string, isGzipped bool, modifiedTime uint64, ttl *TTL, e error) {
form, fe := r.MultipartReader()
if fe != nil {