Help us shape the future of Go! Take the 2026 Go Developer Survey

share

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 22 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 打包流。 鉴权与次数扣减已由 authorizeAndCharge 完成,这里只做读取与响应写出。

Index

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 等注入全部缺失——直传通道的存储配额与审核钩子形同虚设。

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]

Types

This section is empty.

Jump to

Keyboard shortcuts

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