Documentation
¶
Index ¶
- type ExpansionInput
- type ExpansionOutput
- type ExpansionProcessor
- type ShareInfo
- type TaskManager
- func (tm *TaskManager) GetTaskStatus(taskID uint) (string, error)
- func (tm *TaskManager) IsTaskRunning(taskID uint) bool
- func (tm *TaskManager) PauseTask(taskID uint) error
- func (tm *TaskManager) RecoverRunningTasks() error
- func (tm *TaskManager) RegisterProcessor(processor TaskProcessor)
- func (tm *TaskManager) StartTask(taskID uint) error
- func (tm *TaskManager) StopTask(taskID uint) error
- type TaskProcessor
- type TransferInput
- type TransferOutput
- type TransferProcessor
- type TransferResult
- type TransferredResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpansionInput ¶ added in v1.3.0
type ExpansionInput struct {
PanAccountID uint `json:"pan_account_id"`
DataSource map[string]interface{} `json:"data_source,omitempty"`
}
ExpansionInput 扩容任务输入数据结构
type ExpansionOutput ¶ added in v1.3.0
type ExpansionOutput struct {
Success bool `json:"success"`
Message string `json:"message"`
Error string `json:"error,omitempty"`
Time string `json:"time"`
TransferredResources []TransferredResource `json:"transferred_resources,omitempty"`
}
ExpansionOutput 扩容任务输出数据结构
type ExpansionProcessor ¶ added in v1.3.0
type ExpansionProcessor struct {
// contains filtered or unexported fields
}
ExpansionProcessor 扩容任务处理器
func NewExpansionProcessor ¶ added in v1.3.0
func NewExpansionProcessor(repoMgr *repo.RepositoryManager) *ExpansionProcessor
NewExpansionProcessor 创建扩容任务处理器
func (*ExpansionProcessor) GetTaskType ¶ added in v1.3.0
func (ep *ExpansionProcessor) GetTaskType() string
GetTaskType 获取任务类型
type TaskManager ¶
type TaskManager struct {
// contains filtered or unexported fields
}
TaskManager 任务管理器
func NewTaskManager ¶
func NewTaskManager(repoMgr *repo.RepositoryManager) *TaskManager
NewTaskManager 创建任务管理器
func (*TaskManager) GetTaskStatus ¶
func (tm *TaskManager) GetTaskStatus(taskID uint) (string, error)
GetTaskStatus 获取任务状态
func (*TaskManager) IsTaskRunning ¶
func (tm *TaskManager) IsTaskRunning(taskID uint) bool
IsTaskRunning 检查任务是否在运行
func (*TaskManager) RecoverRunningTasks ¶
func (tm *TaskManager) RecoverRunningTasks() error
RecoverRunningTasks 恢复运行中的任务(服务器重启后调用)
func (*TaskManager) RegisterProcessor ¶
func (tm *TaskManager) RegisterProcessor(processor TaskProcessor)
RegisterProcessor 注册任务处理器
type TaskProcessor ¶
type TaskProcessor interface {
Process(ctx context.Context, taskID uint, item *entity.TaskItem) error
GetTaskType() string
}
TaskProcessor 任务处理器接口
type TransferInput ¶
type TransferInput struct {
Title string `json:"title"`
URL string `json:"url"`
CategoryID uint `json:"category_id"`
PanID uint `json:"pan_id"`
Tags []uint `json:"tags"`
}
TransferInput 转存任务输入数据结构
type TransferOutput ¶
type TransferOutput struct {
ResourceID uint `json:"resource_id,omitempty"`
SaveURL string `json:"save_url,omitempty"`
Error string `json:"error,omitempty"`
Success bool `json:"success"`
Time string `json:"time"`
}
TransferOutput 转存任务输出数据结构
type TransferProcessor ¶
type TransferProcessor struct {
// contains filtered or unexported fields
}
TransferProcessor 转存任务处理器
func NewTransferProcessor ¶
func NewTransferProcessor(repoMgr *repo.RepositoryManager) *TransferProcessor
NewTransferProcessor 创建转存任务处理器
func (*TransferProcessor) GetTaskType ¶
func (tp *TransferProcessor) GetTaskType() string
GetTaskType 获取任务类型
type TransferResult ¶
type TransferResult struct {
Success bool `json:"success"`
SaveURL string `json:"save_url"`
Fid string `json:"fid`
ErrorMsg string `json:"error_msg"`
}
TransferResult 转存结果
type TransferredResource ¶ added in v1.3.0
TransferredResource 转存成功的资源信息
Click to show internal directories.
Click to hide internal directories.