handlers

package
v0.0.0-...-ed4fdcb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2017 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLogHandler

func ClearLogHandler(tr interface{}) error

func DisableAndUpdateTask

func DisableAndUpdateTask(o orm.Ormer, old_task *md.Task, update_filed *orm.Params) (int64, error)

目的废弃旧的taskid,再新增一个

func GetTaskInfo

func GetTaskInfo(o orm.Ormer, task_id int64) (md.Task, error)

func GetUpdateField

func GetUpdateField(task *md.Task) (fields orm.Params, is_update_th bool, err error)

func HandleAddTask

func HandleAddTask(c *gin.Context)

http handler,都是正常添加

func HandleQueryTaskStatus

func HandleQueryTaskStatus(c *gin.Context)

func HandleRunAgain

func HandleRunAgain(c *gin.Context)

func HandleServerRecover

func HandleServerRecover()

func HandleUpdateTask

func HandleUpdateTask(c *gin.Context)

func InitInnerCron

func InitInnerCron()

func IsTaskNeedRun

func IsTaskNeedRun(task md.Task) bool

重启时,判断任务是否需要重跑,目前只判断一次性任务,避免运行多次

func IsValidTask

func IsValidTask(task *md.Task) (bool, error)

func ReadRequestJson

func ReadRequestJson(c *gin.Context, obj interface{}) error

func RetryTask

func RetryTask(n *bt.Node)

重试

func RunTask

func RunTask(o orm.Ormer, r bt.RunType, task md.Task) error

func TimerHandler

func TimerHandler(tr interface{}) error

func WriteRespons

func WriteRespons(c *gin.Context, code int, msg string, data interface{})

Types

type AddTaskReq

type AddTaskReq struct {
	TaskList []md.Task `json:"task_list"`
}

增加定时任务

type AddTaskResp

type AddTaskResp struct {
	ResultList []Result `json:"task_result"`
}

type QueryLogArg

type QueryLogArg struct {
	TaskList []TaskInfo `json:"task_list"`
}

查询执行状态

type QueryLogResp

type QueryLogResp struct {
	TaskLog []md.TaskLog `json:"log_list"`
}

type Response

type Response struct {
	State int         `json:"state"`
	Msg   string      `json:"msg"`
	Data  interface{} `json:"data"`
}

type Result

type Result struct {
	Name   string `json:"name`
	TaskId int64  `json:"task_id`
	Err    error  `json:"err`
}

type RunAgainReq

type RunAgainReq struct {
	TaskList []TaskInfo `json:"task_list"`
}

重跑

type RunAgainResp

type RunAgainResp struct {
	ResultList []Result `json:"task_result"`
}

type TaskInfo

type TaskInfo struct {
	TaskId int64  `json:"task_id"`
	Name   string `json:"name"`
}

type UpdateTaskReq

type UpdateTaskReq struct {
	TaskList []md.Task `json:"task_list"`
}

更新定时任务

type UpdateTaskResp

type UpdateTaskResp struct {
	ResultList []Result `json:"task_result"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL