add mime, use simple insert and update filer store API

1. add mime type to file in filer
2. purge old chunks if overwrite during insert
This commit is contained in:
Chris Lu
2018-05-30 20:24:57 -07:00
parent 26e7cd8c75
commit 0301504184
20 changed files with 149 additions and 132 deletions

View File

@@ -17,6 +17,7 @@ func (entry *Entry) EncodeAttributesAndChunks() ([]byte, error) {
FileMode: uint32(entry.Attr.Mode),
Uid: entry.Uid,
Gid: entry.Gid,
Mime: entry.Mime,
},
Chunks: entry.Chunks,
}
@@ -36,6 +37,7 @@ func (entry *Entry) DecodeAttributesAndChunks(blob []byte) error {
entry.Attr.Mode = os.FileMode(message.Attributes.FileMode)
entry.Attr.Uid = message.Attributes.Uid
entry.Attr.Gid = message.Attributes.Gid
entry.Attr.Mime = message.Attributes.Mime
entry.Chunks = message.Chunks