2021-12-05 07:22:19 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
|
|
|
|
type FileStream struct {
|
2021-12-06 09:49:20 +00:00
|
|
|
File io.ReadCloser
|
|
|
|
Size uint64
|
|
|
|
ParentPath string
|
|
|
|
Name string
|
|
|
|
MIMEType string
|
2021-12-05 07:22:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (file FileStream) Read(p []byte) (n int, err error) {
|
|
|
|
return file.File.Read(p)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (file FileStream) GetMIMEType() string {
|
|
|
|
return file.MIMEType
|
|
|
|
}
|
|
|
|
|
|
|
|
func (file FileStream) GetSize() uint64 {
|
|
|
|
return file.Size
|
|
|
|
}
|
|
|
|
|
|
|
|
func (file FileStream) Close() error {
|
|
|
|
return file.File.Close()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (file FileStream) GetFileName() string {
|
|
|
|
return file.Name
|
|
|
|
}
|
|
|
|
|
2021-12-06 09:49:20 +00:00
|
|
|
func (file FileStream) GetParentPath() string {
|
|
|
|
return file.ParentPath
|
2021-12-05 07:22:19 +00:00
|
|
|
}
|