Fix: untracked files

This commit is contained in:
HFO4
2019-12-28 15:50:56 +08:00
parent 132c7a8fcb
commit 2b8921e9fd
17 changed files with 623 additions and 42 deletions

View File

@@ -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
}