Documentation
¶
Index ¶
- type App
- func (app *App) AddDownloadTasks(taskMaps []taskMap) bool
- func (app *App) DisablePlugin(p *plugin.Plugin) *plugin.Plugin
- func (app *App) DownloadPlugin(p *plugin.Plugin) *plugin.Plugin
- func (app *App) EnablePlugin(p *plugin.Plugin) (*plugin.Plugin, string)
- func (app *App) GetConfig() *config.Config
- func (app *App) GetPlugins() map[string]*plugin.Plugin
- func (app *App) OpenExplorer(dir string) error
- func (app *App) OpenFileWithSystemPlayer(filePath string) error
- func (app *App) ParsePlaylist(ids []string) *pb.ParseResponse
- func (app *App) RemoveAllTask(parts []Part) bool
- func (app *App) RemoveTask(uid string) bool
- func (app *App) RunPlugin(p *plugin.Plugin) *plugin.Plugin
- func (app *App) SaveConfig(config *config.Config) bool
- func (app *App) SavePluginConfig(id string, pluginConfig *config.PluginConfig) (*plugin.Plugin, error)
- func (app *App) SetDownloadDir(title string) string
- func (app *App) ShowDownloadInfo(link string) *pb.InfoResponse
- func (app *App) Shutdown(ctx context.Context)
- func (app *App) Startup(ctx context.Context)
- func (app *App) StopPlugin(p *plugin.Plugin) *plugin.Plugin
- func (app *App) TaskParts() []Part
- func (app *App) UpdatePlugin(p *plugin.Plugin) *plugin.Plugin
- func (app *App) UpdatePluginsConfig(id string, pluginConfig *config.PluginConfig) *App
- func (app *App) UpdateSystemConfig(systemConfig *models.SystemConfig) *App
- type AppInfo
- type Cache
- func (c *Cache) AddTask(id string, info *pb.Task)
- func (c *Cache) AddTasks(tasks []*pb.Task)
- func (c *Cache) ClearTasks()
- func (c *Cache) DeleteTask(id string)
- func (c *Cache) Downloader() *plugin.Plugin
- func (c *Cache) SetDownloader(p *plugin.Plugin)
- func (c *Cache) Task(id string) (*pb.Task, bool)
- func (c *Cache) Tasks(ids []string) ([]*pb.Task, error)
- type MessageData
- type Part
- type StreamQuality
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
应用实例
func (*App) DisablePlugin ¶
关闭插件,并禁用插件
func (*App) EnablePlugin ¶
启用插件, 但是不会运行
func (*App) OpenExplorer ¶
func (*App) OpenFileWithSystemPlayer ¶
func (*App) RemoveAllTask ¶
移除任务 移除完成任务: 去除app.tasks目标 并保存配置 移除下载中任务: 调用下载器StopDownload函数 关闭stopChan 移除队列中任务: 清理缓存队列的queueTasks
func (*App) RemoveTask ¶
移除单个任务
- 下载中 调用download.Stop, handleTask续会自动检测tq.queueTasks是否为空, 需要refill等
- 队列中 直接删除对应任务
- 已完成 直接删除对应任务
func (*App) SavePluginConfig ¶
func (app *App) SavePluginConfig(id string, pluginConfig *config.PluginConfig) (*plugin.Plugin, error)
保存插件配置
func (*App) SetDownloadDir ¶
func (*App) ShowDownloadInfo ¶
func (app *App) ShowDownloadInfo(link string) *pb.InfoResponse
获取主页选择下载详情列表
1. 获取下载器 2. 调用展示信息函数 3. 缓存数据
func (*App) UpdatePluginsConfig ¶
func (app *App) UpdatePluginsConfig(id string, pluginConfig *config.PluginConfig) *App
修改插件配置(不会保存)
func (*App) UpdateSystemConfig ¶
func (app *App) UpdateSystemConfig(systemConfig *models.SystemConfig) *App
修改系统配置(不会保存)
type AppInfo ¶
type AppInfo struct { LogDir string ConfigDir string AssetsDir string PluginsDir string // contains filtered or unexported fields }
软件基础信息 aa
func NewAppInfo ¶
func NewAppInfo() AppInfo
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) ClearTasks ¶
func (c *Cache) ClearTasks()
func (*Cache) DeleteTask ¶
func (*Cache) SetDownloader ¶
type MessageData ¶
type Part ¶
type Part struct { URL string // 链接 TaskID string // 唯一标识 ;需创建task时初始化 WorkDirName string // 工作文件夹名 ;需创建task时初始化 DownloadDir string // 下载文件夹完整路径 ;需创建task时初始化 MagicName string // 下载文件名 不带后缀 Path string // 下载文件完整路径 Index int // 所在父级索引 0开始 Author string // 作者 Title string // 标题 Description string // 描述 Width int // 宽度 Height int // 高度 Size int // 字节数 Duration int // 持续时间 秒 PubDate time.Time // 发布日期 Thumbnail string // 封面 Video StreamQuality // 质量标签 Audio StreamQuality // 质量标签 Subtitle string // todo State string // 状态 Status string // 进度 CreatedAt time.Time // 任务创建日期 DownloadPercent int // 下载百分比 DownloadSpeed string // 下载速度 }
任务片段信息
type StreamQuality ¶
Click to show internal directories.
Click to hide internal directories.