diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-05-24 23:21:12 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-05-24 23:21:12 -0700 |
| commit | a01557f4cb98235bbd8d0258ae6f9fcda40f4f9f (patch) | |
| tree | d26297f7aeb9ee9bc975f6b4e4a9a3704c034d56 /weed/filer2 | |
| parent | c11d84f31414997ac43c3c1e638fe762318110d8 (diff) | |
| download | seaweedfs-a01557f4cb98235bbd8d0258ae6f9fcda40f4f9f.tar.xz seaweedfs-a01557f4cb98235bbd8d0258ae6f9fcda40f4f9f.zip | |
adjust filer web page
Diffstat (limited to 'weed/filer2')
| -rw-r--r-- | weed/filer2/filer_structure.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weed/filer2/filer_structure.go b/weed/filer2/filer_structure.go index 5e5382d35..c732d9230 100644 --- a/weed/filer2/filer_structure.go +++ b/weed/filer2/filer_structure.go @@ -55,6 +55,18 @@ type Entry struct { Chunks []*filer_pb.FileChunk `json:"chunks,omitempty"` } +func (entry Entry) Size() uint64 { + return TotalSize(entry.Chunks) +} + +func (entry Entry) Timestamp() time.Time { + if entry.IsDirectory() { + return entry.Crtime + } else { + return entry.Mtime + } +} + type AbstractFiler interface { CreateEntry(*Entry) (error) AppendFileChunk(FullPath, []*filer_pb.FileChunk) (err error) |
