You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
637 B
39 lines
637 B
5 years ago
|
package local
|
||
|
|
||
5 years ago
|
import (
|
||
|
"io"
|
||
|
)
|
||
5 years ago
|
|
||
5 years ago
|
// FileStream 用户传来的文件
|
||
5 years ago
|
type FileStream struct {
|
||
5 years ago
|
File io.ReadCloser
|
||
|
Size uint64
|
||
|
VirtualPath string
|
||
|
Name string
|
||
|
MIMEType string
|
||
5 years ago
|
}
|
||
|
|
||
|
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
|
||
|
}
|
||
5 years ago
|
|
||
|
func (file FileStream) GetVirtualPath() string {
|
||
|
return file.VirtualPath
|
||
|
}
|