Documentation
¶
Index ¶
- Constants
- Variables
- func DoSessionTask(tasks []models.SessionTaskInfo)
- func EnableFetchingTask()
- func Fetch(from_kick bool, taskId string, taskType int) int
- func FetchTaskList(reason FetchReason, taskId string, taskType int, isColdstart bool) *taskCollection
- func GetDispatcher() *taskDispatcher
- func IsStartupFetched() bool
- func ReportSessionResult(taskID string, status string)
- func SendFileFinished(sendFile models.SendFileTaskInfo, status int)
- func SendFileInvalid(sendFile models.SendFileTaskInfo, status int)
- func SendFiles(sendFileTasks []models.SendFileTaskInfo)
- type FetchReason
- type FinishCallback
- type PeriodicTaskSchedule
- type ReportErrorCallback
- type SessionFactory
- type SessionTask
- type Task
- func (task *Task) Cancel(quietly bool, taskRunning bool) error
- func (task *Task) IsCancled() bool
- func (task *Task) PreCheck(reportVerified bool) error
- func (task *Task) ResetCancel()
- func (task *Task) Run() (taskerrors.ErrorCode, error)
- func (task *Task) SendError(output string, errCode fmt.Stringer, errDesc string)
- func (task *Task) SendInvalidTask(param string, value string)
- type TaskFactory
- func (t *TaskFactory) AddNamedTask(name string, task *Task) error
- func (t *TaskFactory) AddTask(task *Task) error
- func (t *TaskFactory) ContainsTaskByName(name string) bool
- func (t *TaskFactory) GetTask(name string) (*Task, bool)
- func (t *TaskFactory) IsAnyNonPeriodicTaskRunning() bool
- func (t *TaskFactory) IsAnyTaskRunning() bool
- func (t *TaskFactory) RemoveTaskByName(name string)
- type TaskFunction
- type TaskReportResp
Constants ¶
View Source
const ( TaskReportErrTaskNotFound = "TaskNotFound" TaskReportErrTaskStatusInvalid = "TaskStatusInvalid" TaskInvalidStatusTerminated = "Terminated" )
View Source
const ( NormalTaskType = 0 SessionTaskType = 1 )
View Source
const ( ESuccess = 0 EFileCreateFail = 1 EChownError = 2 EChmodError = 3 ECreateDirFailed = 4 EInvalidFilePath = 10 EFileAlreadyExist = 11 EEmptyContent = 12 EInvalidContent = 13 EInvalidContentType = 14 EInvalidFileType = 15 EInvalidSignature = 16 EInalidFileMode = 17 EInalidGID = 18 EInalidUID = 19 )
View Source
const (
ErrUpdatingProcedureRunning = -7
)
View Source
const (
LAUNCHER_CMDLINE = "LAUNCHER_CMDLINE"
)
Variables ¶
View Source
var ( // FetchingTaskLock indicates whether one goroutine is fetching tasks FetchingTaskLock heavylock.CASMutex // FetchingTaskCounter indicates how many goroutines are fetching tasks FetchingTaskCounter atomicutil.AtomicInt32 )
View Source
var G_IsFreebsd bool = false
View Source
var G_IsLinux bool = false
View Source
var G_IsWindows bool = false
Functions ¶
func DoSessionTask ¶
func DoSessionTask(tasks []models.SessionTaskInfo)
func EnableFetchingTask ¶
func EnableFetchingTask()
EnableFetchingTask sets prviate indicator to allow fetching tasks
func FetchTaskList ¶
func FetchTaskList(reason FetchReason, taskId string, taskType int, isColdstart bool) *taskCollection
func GetDispatcher ¶
func GetDispatcher() *taskDispatcher
func IsStartupFetched ¶
func IsStartupFetched() bool
func ReportSessionResult ¶
func SendFileFinished ¶
func SendFileFinished(sendFile models.SendFileTaskInfo, status int)
func SendFileInvalid ¶
func SendFileInvalid(sendFile models.SendFileTaskInfo, status int)
func SendFiles ¶
func SendFiles(sendFileTasks []models.SendFileTaskInfo)
Types ¶
type FetchReason ¶
type FetchReason string
const ( FetchOnKickoff FetchReason = "kickoff" FetchOnStartup FetchReason = "startup" )
type FinishCallback ¶
type FinishCallback func()
type PeriodicTaskSchedule ¶
type PeriodicTaskSchedule struct {
// contains filtered or unexported fields
}
PeriodicTaskSchedule consists of timer and reusable invocation data structure for periodic task
type ReportErrorCallback ¶
type ReportErrorCallback func(taskId string, repeat models.RunTaskRepeatType, errorCode, status string) (isTaskErr bool)
type SessionFactory ¶
type SessionFactory struct {
// contains filtered or unexported fields
}
func GetSessionFactory ¶
func GetSessionFactory() *SessionFactory
func (*SessionFactory) AddSessionTask ¶
func (t *SessionFactory) AddSessionTask(task *SessionTask)
func (*SessionFactory) ContainsTask ¶
func (t *SessionFactory) ContainsTask(name string) bool
func (*SessionFactory) GetTask ¶
func (t *SessionFactory) GetTask(name string) (*SessionTask, bool)
func (*SessionFactory) IsAnyTaskRunning ¶
func (t *SessionFactory) IsAnyTaskRunning() bool
func (*SessionFactory) RemoveTask ¶
func (t *SessionFactory) RemoveTask(name string)
type SessionTask ¶
type SessionTask struct {
// contains filtered or unexported fields
}
func NewSessionTask ¶
func (*SessionTask) RunTask ¶
func (sessionTask *SessionTask) RunTask(taskid string) error
func (*SessionTask) StopTask ¶
func (sessionTask *SessionTask) StopTask() error
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func NewTask ¶
func NewTask(taskInfo models.RunTaskInfo, scheduleLocation *time.Location, onFinish FinishCallback, onReportError ReportErrorCallback) (*Task, error)
func (*Task) Cancel ¶
Cancel the task invocation. If quietly is false, notify server the task is canceled.
func (*Task) SendInvalidTask ¶
type TaskFactory ¶
type TaskFactory struct {
// contains filtered or unexported fields
}
func GetTaskFactory ¶
func GetTaskFactory() *TaskFactory
func (*TaskFactory) AddNamedTask ¶
func (t *TaskFactory) AddNamedTask(name string, task *Task) error
func (*TaskFactory) AddTask ¶
func (t *TaskFactory) AddTask(task *Task) error
func (*TaskFactory) ContainsTaskByName ¶
func (t *TaskFactory) ContainsTaskByName(name string) bool
func (*TaskFactory) IsAnyNonPeriodicTaskRunning ¶
func (t *TaskFactory) IsAnyNonPeriodicTaskRunning() bool
IsAnyNonPeriodicTaskRunning scans each task registered in TaskFactory which means "running" and checks whether it is non-periodic task.
func (*TaskFactory) IsAnyTaskRunning ¶
func (t *TaskFactory) IsAnyTaskRunning() bool
IsAnyTaskRunning returns true when any task exists in TaskFactory, otherwise false.
func (*TaskFactory) RemoveTaskByName ¶
func (t *TaskFactory) RemoveTaskByName(name string)
type TaskFunction ¶
type TaskFunction func()
type TaskReportResp ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.