Browse Source

add String function for needle to print

pull/38/head
yanyiwu 10 years ago
parent
commit
089eb8ad39
  1. 6
      go/storage/needle.go

6
go/storage/needle.go

@ -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 {

Loading…
Cancel
Save