add leveldb store

1. switch to viper for filer store configuration
2. simplify FindEntry() return values, removing “found”
3. add leveldb store
This commit is contained in:
Chris Lu
2018-05-26 03:49:46 -07:00
parent c34feca59c
commit 9e77563c99
17 changed files with 382 additions and 193 deletions

View File

@@ -28,15 +28,14 @@ type Entry struct {
Chunks []*filer_pb.FileChunk `json:"chunks,omitempty"`
}
func (entry Entry) Size() uint64 {
func (entry *Entry) Size() uint64 {
return TotalSize(entry.Chunks)
}
func (entry Entry) Timestamp() time.Time {
func (entry *Entry) Timestamp() time.Time {
if entry.IsDirectory() {
return entry.Crtime
} else {
return entry.Mtime
}
}