share

package
v0.33.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

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 打包流。 鉴权与计次由调用方完成(authorizeDownload + chargePickup),这里只做读取与响应写出。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 SetShareService

func SetShareService(s *shareService.Service)

SetShareService 注入共享的 share service 实例(bootstrap 调用)。 回归(治理 2026-10-03):此前未注入,/share/text|file|select|download 走 getShareService() 懒加载裸实例,quotaChecker/notify/userService/moderator 等注入全部缺失——直传通道的存储配额与审核钩子形同虚设。

func ShareFile

func ShareFile(ctx context.Context, c *app.RequestContext)

ShareFile . @router /share/file/ [POST]

func ShareText

func ShareText(ctx context.Context, c *app.RequestContext)

ShareText . @router /share/text/ [POST]

func UserSharesBatchDelete added in v0.15.0

func UserSharesBatchDelete(ctx context.Context, c *app.RequestContext)

UserSharesBatchDelete 批量软删除我的分享 POST /api/v1/user/shares/batch-delete

func UserSharesBatchExtend added in v0.15.0

func UserSharesBatchExtend(ctx context.Context, c *app.RequestContext)

UserSharesBatchExtend 批量延期我的分享 POST /api/v1/user/shares/batch-extend

func UserSharesHardDelete added in v0.15.0

func UserSharesHardDelete(ctx context.Context, c *app.RequestContext)

UserSharesHardDelete 永久删除(仅已软删除的) DELETE /api/v1/user/shares/:code/hard

func UserSharesList added in v0.15.0

func UserSharesList(ctx context.Context, c *app.RequestContext)

UserSharesList 我的分享列表 GET /api/v1/user/shares?status=&search=&page=&page_size=

func UserSharesRestore added in v0.15.0

func UserSharesRestore(ctx context.Context, c *app.RequestContext)

UserSharesRestore 恢复软删除的分享 POST /api/v1/user/shares/:code/restore

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL