Documentation ¶
Index ¶
- Constants
- func Command()
- func CommandUI()
- func ShowProtocolInfo(url string)
- func ShowProtocolInfoMaster(url string)
- type DownloadCacheData
- func (cache *DownloadCacheData) Complete(downloadData DownloadData, err error)
- func (cache *DownloadCacheData) DownloadingLen() int
- func (cache *DownloadCacheData) ErrorLen() int
- func (cache *DownloadCacheData) Pop() (result DownloadData, err error)
- func (cache *DownloadCacheData) Push(list []DownloadData)
- func (cache *DownloadCacheData) ReadyLen() int
- type DownloadData
- type Downloader
- type DownloaderOption
Constants ¶
View Source
const ( CONST_BASE_SLICE_FILE_EXT = ".ts" // 分片文件扩展名 CONST_BASE_RETRY_MAX_COUNT = 3 // 下载分片文件的最大重试次数 )
Variables ¶
This section is empty.
Functions ¶
func ShowProtocolInfoMaster ¶
func ShowProtocolInfoMaster(url string)
Types ¶
type DownloadCacheData ¶
type DownloadCacheData struct {
// contains filtered or unexported fields
}
func (*DownloadCacheData) Complete ¶
func (cache *DownloadCacheData) Complete(downloadData DownloadData, err error)
完成下载,将下载对象从正在下载队列中移除 如果有错误,暂时放到异常队列中,等待重试
func (*DownloadCacheData) DownloadingLen ¶
func (cache *DownloadCacheData) DownloadingLen() int
func (*DownloadCacheData) ErrorLen ¶
func (cache *DownloadCacheData) ErrorLen() int
func (*DownloadCacheData) Pop ¶
func (cache *DownloadCacheData) Pop() (result DownloadData, err error)
从待下载队列中取出一个下载对象,放到正在下载队列中
func (*DownloadCacheData) Push ¶
func (cache *DownloadCacheData) Push(list []DownloadData)
将需要加载的数据对象,添加到等待下载队列中
func (*DownloadCacheData) ReadyLen ¶
func (cache *DownloadCacheData) ReadyLen() int
type DownloadData ¶
type DownloadData struct { Index int // 下载资源索引 Key string // 下载资源的唯一标示 Title string // 文件名 Url string // 下载链接 DownloadPath string // 文件保存路径 EncryptKey string // 加密密钥 }
下载文件结构
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
下载器
func New ¶
func New(url string) (result *Downloader, err error)
func (*Downloader) CheckMaster ¶
func (dl *Downloader) CheckMaster() (result protocol.HlsMaster, err error)
type DownloaderOption ¶
下载器参数
Click to show internal directories.
Click to hide internal directories.