diff options
| author | chrislusf <chris.lu@gmail.com> | 2014-12-26 01:29:30 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2014-12-26 01:29:30 -0800 |
| commit | 763f5e16c7238b8e4b30ea60560212fb927a8873 (patch) | |
| tree | ec86ea79cb296d838a5d8eaa71ec7a30705e6d90 /go/storage/needle.go | |
| parent | 8651f7c7276042332fb3edf545f7a7a3af3e0dec (diff) | |
| parent | 5b7628cf08b246bb8dd075a28f29e1bd3401eb2d (diff) | |
| download | seaweedfs-763f5e16c7238b8e4b30ea60560212fb927a8873.tar.xz seaweedfs-763f5e16c7238b8e4b30ea60560212fb927a8873.zip | |
Merge pull request #38 from aszxqw/master
fix
Diffstat (limited to 'go/storage/needle.go')
| -rw-r--r-- | go/storage/needle.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/go/storage/needle.go b/go/storage/needle.go index aa3206920..11610dd80 100644 --- a/go/storage/needle.go +++ b/go/storage/needle.go @@ -3,6 +3,7 @@ package storage import ( "encoding/hex" "errors" + "fmt" "io/ioutil" "mime" "net/http" @@ -24,6 +25,7 @@ const ( ) /* +* A Needle means a uploaded and stored file. * Needle file size is limited to 4GB for now. */ type Needle struct { @@ -45,6 +47,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 { |
