feat: add Mime to File

This commit is contained in:
Derrick Hammer 2024-01-25 19:17:48 -05:00
parent be27728b42
commit c051ef8e44
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,7 @@ type File interface {
HashString() string HashString() string
Name() string Name() string
Modtime() time.Time Modtime() time.Time
Mime() string
Size() uint64 Size() uint64
CID() *encoding.CID CID() *encoding.CID
Exists() bool Exists() bool

View File

@ -165,3 +165,12 @@ func (f *FileImpl) CID() *encoding.CID {
} }
return f.cid return f.cid
} }
func (f *FileImpl) Mime() string {
record, err := f.Record()
if err != nil {
return ""
}
return record.MimeType
}