adjust filer web page

This commit is contained in:
Chris Lu
2018-05-24 23:21:12 -07:00
parent c11d84f314
commit a01557f4cb
3 changed files with 30 additions and 6 deletions

View File

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