Documentation ¶
Index ¶
- func CreateConfigFile(taskDir string, cfgBytes []byte) (string, error)
- func CreateNewTaskDir(rootDir string, id string) (string, error)
- func DeleteImportTask(tasksDir, taskID, address, username string) error
- func GetImportTask(taskID, address, username string) (*types.GetImportTaskData, error)
- func GetManyImportTask(address, username, space string, pageIndex, pageSize int, status string) (*types.GetManyImportTaskData, error)
- func InitTask()
- func NewTaskMgr(serverName string, tackConfig *types.TaskConfig)
- func StartImport(taskID string) (err error)
- func StopImportTask(taskID, address, username string) error
- type Client
- type ImportResult
- type Task
- type TaskMgr
- func (mgr *TaskMgr) AbortTask(taskID, msg string) (err error)
- func (mgr *TaskMgr) DelTask(tasksDir, taskID string) error
- func (mgr *TaskMgr) FinishTask(taskID, status string) (err error)
- func (mgr *TaskMgr) GetDcron() *dcron.Dcron
- func (mgr *TaskMgr) GetTask(taskID string) (*Task, bool)
- func (mgr *TaskMgr) GetTaskInfoByName(taskName string) (task *db.TaskInfo, err error)
- func (mgr *TaskMgr) NewTask(id, cron, host, user, taskName string, rawConfig string, ...) (*Task, error)
- func (mgr *TaskMgr) NewTaskDraft(id, host, user, taskName, space, rawCfg string) error
- func (mgr *TaskMgr) NewTaskEffect(taskEffect *db.TaskEffect) error
- func (mgr *TaskMgr) PutTask(taskID string, task *Task)
- func (mgr *TaskMgr) StartTask(info *db.TaskInfo) error
- func (mgr *TaskMgr) Stop()
- func (mgr *TaskMgr) StopTask(taskID string) error
- func (mgr *TaskMgr) StorePartTaskLog(taskID string) error
- func (mgr *TaskMgr) TurnDraftToTask(id, cron, taskName string, rawCfg string, cfg *types.ImportTaskV2Config) (*Task, error)
- func (mgr *TaskMgr) UpdateTask(task *Task) error
- func (mgr *TaskMgr) UpdateTaskDraft(id, taskName, space, rawCfg string) error
- func (mgr *TaskMgr) UpdateTaskInfo(taskID string) error
- func (mgr *TaskMgr) UpdateTaskInfoById(task *Task) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteImportTask ¶
func GetImportTask ¶
func GetImportTask(taskID, address, username string) (*types.GetImportTaskData, error)
func GetManyImportTask ¶
func NewTaskMgr ¶
func NewTaskMgr(serverName string, tackConfig *types.TaskConfig)
func StartImport ¶
func StopImportTask ¶
Types ¶
type ImportResult ¶
type Task ¶
type Task struct { Client *Client `json:"client,omitempty"` TaskInfo *db.TaskInfo `json:"task_info,omitempty"` }
func UnmarshalTask ¶
func (*Task) ToImportTaskData ¶
func (t *Task) ToImportTaskData() (result *types.GetImportTaskData, err error)
func (*Task) UpdateQueryStats ¶
type TaskMgr ¶
type TaskMgr struct {
// contains filtered or unexported fields
}
func GetTaskMgr ¶
func GetTaskMgr() *TaskMgr
func (*TaskMgr) FinishTask ¶
FinishTask will query task stats
- delete task in the map
- update taskInfo in db
- update taskEffect in db
func (*TaskMgr) GetTaskInfoByName ¶
func (*TaskMgr) NewTaskDraft ¶
func (*TaskMgr) NewTaskEffect ¶
func (mgr *TaskMgr) NewTaskEffect(taskEffect *db.TaskEffect) error
func (*TaskMgr) StopTask ¶
StopTask will change the task status to `Stopped`, and then call FinishTask
func (*TaskMgr) StorePartTaskLog ¶
func (*TaskMgr) TurnDraftToTask ¶
func (*TaskMgr) UpdateTask ¶
func (*TaskMgr) UpdateTaskDraft ¶
func (*TaskMgr) UpdateTaskInfo ¶
UpdateTaskInfo will query task stats, update task in the map and update the taskInfo in local sql
func (*TaskMgr) UpdateTaskInfoById ¶
UpdateTaskInfoById Update task info by task id
Click to show internal directories.
Click to hide internal directories.