tasks

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: GPL-3.0, GPL-3.0-or-later Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TasksInfo []byte

	Tasks []Task

	Crons = make([]cron.Cron, 0, 1)
)

Functions

func AddCron

func AddCron(id int)

func DeleteCron

func DeleteCron(id int)

func HandleTask

func HandleTask(ctx *gin.Context)

func HandleTaskLog added in v0.0.2

func HandleTaskLog(ctx *gin.Context)

func HandleTaskRunOne added in v0.0.2

func HandleTaskRunOne(ctx *gin.Context)

func HandleTaskUpdate

func HandleTaskUpdate(ctx *gin.Context)

func HandleTasks

func HandleTasks(ctx *gin.Context)

func HandleTasksAdd

func HandleTasksAdd(ctx *gin.Context)

func HandleTasksCount added in v0.0.2

func HandleTasksCount(ctx *gin.Context)

func HandleTasksDelete

func HandleTasksDelete(ctx *gin.Context)

func LoadTasks

func LoadTasks(tasksInfo []byte)

func PlanningTasks

func PlanningTasks()

func ReadTaskLog added in v0.0.2

func ReadTaskLog(id int) (data string, success bool)

func ReloadTasksInfo

func ReloadTasksInfo()

func RunTask added in v0.0.2

func RunTask(id int)

func SaveTaskInfo

func SaveTaskInfo(id int, task TaskData) bool

SaveTaskInfo 保存任务信息

func SaveTasks added in v0.0.2

func SaveTasks() bool

SaveTask 保存任务

func UpdateCron

func UpdateCron(id int, task TaskData, file *multipart.FileHeader, change bool, ctx *gin.Context)

Types

type Task

type Task struct {
	Id       int    `json:"id"`
	Success  bool   `json:"success"`
	Location string `json:"location"`
}

type TaskData

type TaskData struct {
	Name    string `json:"name"`
	Info    string `json:"info"`
	Diy     bool   `json:"diy"`
	Cycle   string `json:"cycle"`
	Command string `json:"command"`
	File    string `json:"file"`
	Lastime int64  `json:"lastime"`
}

func ReadTaskInfo

func ReadTaskInfo(id int) TaskData

type TaskInfoData

type TaskInfoData struct {
	Id      int    `json:"id"`
	Name    string `json:"name"`
	Info    string `json:"info"`
	Success bool   `json:"success"`
	Diy     bool   `json:"diy"`
	Cycle   string `json:"cycle"`
	Lastime string `json:"lastime"`
	Command string `json:"command"`
}

type TaskResponse

type TaskResponse struct {
	Code    int          `json:"code"`    // 返回代码
	Success bool         `json:"success"` // 验证成功
	Message string       `json:"message"` // 消息
	Data    TaskInfoData `json:"data"`
}

回复信息

func AddTaskResponse

func AddTaskResponse(code int, success bool, message string, id int) TaskResponse

type TasksList

type TasksList struct {
	Total   int             `json:"total"`
	Content []TasksListInfo `json:"content"`
}

type TasksListInfo

type TasksListInfo struct {
	Id      int    `json:"id"`
	Name    string `json:"name"`
	Info    string `json:"info"`
	Success bool   `json:"success"`
	Diy     bool   `json:"diy"`
	Lastime string `json:"lastime"`
}

type TasksResponse

type TasksResponse struct {
	Code    int       `json:"code"`    // 返回代码
	Success bool      `json:"success"` // 验证成功
	Message string    `json:"message"` // 消息
	Data    TasksList `json:"data"`
}

func AddTasksResponse

func AddTasksResponse(code int, success bool, message string, tasksList []TasksListInfo) TasksResponse

Jump to

Keyboard shortcuts

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