feat: add Mime to File
This commit is contained in:
parent
be27728b42
commit
c051ef8e44
|
@ -13,6 +13,7 @@ type File interface {
|
|||
HashString() string
|
||||
Name() string
|
||||
Modtime() time.Time
|
||||
Mime() string
|
||||
Size() uint64
|
||||
CID() *encoding.CID
|
||||
Exists() bool
|
||||
|
|
|
@ -165,3 +165,12 @@ func (f *FileImpl) CID() *encoding.CID {
|
|||
}
|
||||
return f.cid
|
||||
}
|
||||
|
||||
func (f *FileImpl) Mime() string {
|
||||
record, err := f.Record()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
return record.MimeType
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue