Documentation
¶
Overview ¶
download_range.go — 远端后端的 Range 下载(断点续传/P3 下载续传)。
本地后端由 c.File 原生支持 Range/206;远端后端此前只能全量 200, 播放器拖动/断点续传类客户端无法工作。这里补齐服务端区间流: 驱动层(s3 原生 Range GET,fs 走 Seek)→ StorageService.GetFileReaderRange → share.OpenShareDownloadRange → 本文件的解析与 206 响应。 驱动不支持区间读(webdav/ftp 等)时优雅回退全量 200。
多文件分享下载辅助(P0 多文件):子文件单流 + zip 打包流。 鉴权与次数扣减已由 authorizeAndCharge 完成,这里只做读取与响应写出。
Index ¶
- func DeleteShare(ctx context.Context, c *app.RequestContext)
- func DownloadFile(ctx context.Context, c *app.RequestContext)
- func GetShare(ctx context.Context, c *app.RequestContext)
- func GetUserShares(ctx context.Context, c *app.RequestContext)
- func SetShareService(s *shareService.Service)
- func ShareFile(ctx context.Context, c *app.RequestContext)
- func ShareText(ctx context.Context, c *app.RequestContext)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteShare ¶
func DeleteShare(ctx context.Context, c *app.RequestContext)
DeleteShare 删除分享 @router /share/:code [DELETE]
func DownloadFile ¶
func DownloadFile(ctx context.Context, c *app.RequestContext)
DownloadFile 下载分享文件 @router /share/download [GET]
func GetShare ¶
func GetShare(ctx context.Context, c *app.RequestContext)
GetShare . @router /share/select/ [GET]
func GetUserShares ¶
func GetUserShares(ctx context.Context, c *app.RequestContext)
GetUserShares 获取用户的分享列表 @router /share/user [GET]
func SetShareService ¶
func SetShareService(s *shareService.Service)
SetShareService 注入共享的 share service 实例(bootstrap 调用)。 回归(治理 2026-10-03):此前未注入,/share/text|file|select|download 走 getShareService() 懒加载裸实例,quotaChecker/notify/userService/moderator 等注入全部缺失——直传通道的存储配额与审核钩子形同虚设。
Types ¶
This section is empty.