aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-05-24 23:21:12 -0700
committerChris Lu <chris.lu@gmail.com>2018-05-24 23:21:12 -0700
commita01557f4cb98235bbd8d0258ae6f9fcda40f4f9f (patch)
treed26297f7aeb9ee9bc975f6b4e4a9a3704c034d56 /weed/filer2
parentc11d84f31414997ac43c3c1e638fe762318110d8 (diff)
downloadseaweedfs-a01557f4cb98235bbd8d0258ae6f9fcda40f4f9f.tar.xz
seaweedfs-a01557f4cb98235bbd8d0258ae6f9fcda40f4f9f.zip
adjust filer web page
Diffstat (limited to 'weed/filer2')
-rw-r--r--weed/filer2/filer_structure.go12
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)