saTask

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCase

func AddCase(c *Case) (err error)

func CheckSpec

func CheckSpec(spec string) (ok bool)

func DelCase

func DelCase(key string) (err error)

func Event

func Event(in *EventRequest) (err error)

Event 事件请求

func Init

func Init(cases ...Case)

Init 初始化

func IsCaseExist

func IsCaseExist(key string) bool

func Status

func Status(key string) (out map[string]string, err error)

Types

type Case

type Case struct {
	Key     string //任务唯一标识
	Spec    string //非空
	Handler Handler
	Params  string
}

type EventRequest

type EventRequest struct {
	Key    string `json:"key"`
	Event  string `json:"event"` //start, stop, once
	Spec   string `json:"spec"`
	Params string `json:"params"`
}

type Handler

type Handler task.Handler

type TaskInfo

type TaskInfo struct {
	Id     int64  `orm:"" json:"id" form:"id"`
	App    string `orm:"varchar(20);comment:系统名" json:"app" form:"app"`
	Key    string `orm:"varchar(30);comment:任务唯一标识" json:"key" form:"key"`
	Name   string `orm:"varchar(40);comment:任务名" json:"name" form:"name"`
	Status int    `orm:"tinyint;comment:-1-已删除 1-暂停 2-正常" json:"status" form:"status"`
	Spec   string `orm:"varchar(40)" json:"spec" form:"spec"`
	Params string `orm:"varchar(500);comment:执行任务时参数" json:"params" form:"params"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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