Documentation
¶
Index ¶
- func StreamingUploadHandler(h *Handler) http.HandlerFunc
- func UploadHandler(h *Handler) http.HandlerFunc
- type ArchiveReq
- type DeleteReq
- type Handler
- func (h *Handler) Archive(ctx *gin.Context, req ArchiveReq) (ginx.Result, error)
- func (h *Handler) Delete(ctx *gin.Context, req DeleteReq) (ginx.Result, error)
- func (h *Handler) DownloadStream(ctx *gin.Context)
- func (h *Handler) Index(ctx *gin.Context) (ginx.Result, error)
- func (h *Handler) Move(ctx *gin.Context, req MoveReq) (ginx.Result, error)
- func (h *Handler) NewFile(ctx *gin.Context, req NewFileReq) (ginx.Result, error)
- func (h *Handler) NewFolder(ctx *gin.Context, req NewFolderReq) (ginx.Result, error)
- func (h *Handler) Preview(ctx *gin.Context) (ginx.Result, error)
- func (h *Handler) RegisterRoutes(server *gin.Engine)
- func (h *Handler) RegisterUploadRoute(server *gin.Engine)
- func (h *Handler) Rename(ctx *gin.Context, req RenameReq) (ginx.Result, error)
- func (h *Handler) Save(ctx *gin.Context, req SaveReq) (ginx.Result, error)
- func (h *Handler) Search(ctx *gin.Context) (ginx.Result, error)
- func (h *Handler) SetFinder(id int64, f provider.CapabilityProvider)
- func (h *Handler) Unarchive(ctx *gin.Context, req UnarchiveReq) (ginx.Result, error)
- func (h *Handler) Upload(ctx *gin.Context) (ginx.Result, error)
- type Item
- type MoveReq
- type NewFileReq
- type NewFolderReq
- type RenameReq
- type RetrieveFolder
- type SaveReq
- type UnarchiveReq
- type UploadMessage
- type UploadReq
- type UploadSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamingUploadHandler ¶ added in v1.0.6
func StreamingUploadHandler(h *Handler) http.HandlerFunc
StreamingUploadHandler 使用原生 net/http 实现流式上传 绕过 Gin 的 multipart 解析,实现真正的边接收边写入
func UploadHandler ¶ added in v1.0.6
func UploadHandler(h *Handler) http.HandlerFunc
UploadHandler 处理 WebSocket 文件上传
Types ¶
type ArchiveReq ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler() *Handler
func NewHandlerWithConfig ¶ added in v1.1.0
func NewHandlerWithConfig() *Handler
func (*Handler) DownloadStream ¶ added in v1.0.8
DownloadStream 使用 http.ServeContent 实现流式下载,自动支持 Range/206
func (*Handler) RegisterRoutes ¶
func (*Handler) RegisterUploadRoute ¶ added in v1.0.6
RegisterUploadRoute 单独注册上传路由,在中间件之前 使用流式上传以支持实时进度显示
func (*Handler) SetFinder ¶ added in v1.0.1
func (h *Handler) SetFinder(id int64, f provider.CapabilityProvider)
type NewFileReq ¶
type NewFolderReq ¶
type RetrieveFolder ¶
type UnarchiveReq ¶ added in v1.0.6
type UploadMessage ¶ added in v1.0.6
type UploadMessage struct {
Type string `json:"type"` // 消息类型
ID string `json:"id"` // 上传任务 ID
FileName string `json:"fileName"` // 文件名
Path string `json:"path"` // 目标路径
Data json.RawMessage `json:"data"` // 数据(base64 编码的文件块或元数据)
Size int64 `json:"size"` // 文件总大小
Offset int64 `json:"offset"` // 当前偏移量(已接收的字节数)
SFTPWritten int64 `json:"sftpWritten"` // 已写入 SFTP 的字节数(实时进度)
Error string `json:"error"` // 错误信息
SFTPWriteStart int64 `json:"sftpWriteStart"` // SFTP 写入开始时间(Unix 毫秒时间戳)
SFTPWriteEnd int64 `json:"sftpWriteEnd"` // SFTP 写入结束时间(Unix 毫秒时间戳)
SFTPWriteDuration int64 `json:"sftpWriteDuration"` // SFTP 写入耗时(毫秒)
FinalName string `json:"finalName"`
}
UploadMessage WebSocket 消息结构
type UploadSession ¶ added in v1.0.6
type UploadSession struct {
ID string
FileName string
Path string
Size int64
Sess provider.UploadSession
Finder provider.CapabilityProvider
Offset int64
// contains filtered or unexported fields
}
UploadSession 上传会话
Click to show internal directories.
Click to hide internal directories.