mirror of
https://github.com/AlistGo/alist.git
synced 2025-05-25 01:10:44 +08:00
🚧 webdav write interface
This commit is contained in:
35
model/file_stream.go
Normal file
35
model/file_stream.go
Normal file
@ -0,0 +1,35 @@
|
||||
package model
|
||||
|
||||
import "io"
|
||||
|
||||
type FileStream struct {
|
||||
File io.ReadCloser
|
||||
Size uint64
|
||||
Path string
|
||||
Name string
|
||||
MIMEType string
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
func (file FileStream) GetPath() string {
|
||||
return file.Path
|
||||
}
|
Reference in New Issue
Block a user