mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-17 22:58:07 +00:00
Fix: untracked files
This commit is contained in:
1 parent
132c7a8fcb
commit
2b8921e9fd
17 files changed
+623
-42
No files matched your search
@@ -5,7 +5,9 @@ import (
|
||||
"github.com/HFO4/cloudreve/models"
|
||||
"github.com/HFO4/cloudreve/pkg/conf"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem/local"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem/remote"
|
||||
"github.com/HFO4/cloudreve/pkg/filesystem/response"
|
||||
"github.com/HFO4/cloudreve/pkg/serializer"
|
||||
"github.com/gin-gonic/gin"
|
||||
"io"
|
||||
"net/url"
|
||||
@@ -39,6 +41,9 @@ type Handler interface {
|
||||
// url - 站点本身地址,
|
||||
// isDownload - 是否直接下载
|
||||
Source(ctx context.Context, path string, url url.URL, ttl int64, isDownload bool) (string, error)
|
||||
|
||||
// Token 获取有效期为ttl的上传凭证和签名,同时回调会话有效期为sessionTTL
|
||||
Token(ctx context.Context, ttl int64, callbackKey string) (serializer.UploadCredential, error)
|
||||
}
|
||||
|
||||
// FileSystem 管理文件的文件系统
|
||||
@@ -124,6 +129,11 @@ func (fs *FileSystem) dispatchHandler() error {
|
||||
Policy: currentPolicy,
|
||||
}
|
||||
return nil
|
||||
case "remote":
|
||||
fs.Handler = remote.Handler{
|
||||
Policy: currentPolicy,
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
return ErrUnknownPolicyType
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user