mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-07-18 17:38:07 +08:00

* fix(crypt): bug caused by link cache * perf(crypt,mega,halalcloud,quark,uc): optimize concurrent response link * chore: 删除无用代码 * ftp * 修复bug;资源释放 * 添加SyncClosers * local,sftp,smb * 重构,优化,增强 * Update internal/stream/util.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com> * chore * chore * 优化,修复bug * . --------- Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
33 lines
472 B
Go
33 lines
472 B
Go
package model
|
|
|
|
import (
|
|
"errors"
|
|
"io"
|
|
)
|
|
|
|
// File is basic file level accessing interface
|
|
type File interface {
|
|
io.Reader
|
|
io.ReaderAt
|
|
io.Seeker
|
|
}
|
|
type FileCloser struct {
|
|
File
|
|
io.Closer
|
|
}
|
|
|
|
func (f *FileCloser) Close() error {
|
|
var errs []error
|
|
if clr, ok := f.File.(io.Closer); ok {
|
|
errs = append(errs, clr.Close())
|
|
}
|
|
if f.Closer != nil {
|
|
errs = append(errs, f.Closer.Close())
|
|
}
|
|
return errors.Join(errs...)
|
|
}
|
|
|
|
type FileRangeReader struct {
|
|
RangeReaderIF
|
|
}
|