service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DATATIME_FORMAT = "2006-01-02 15:04:05"

Variables

View Source
var CronArray sync.Map

容器

View Source
var TASK_MAP sync.Map

任务队列,用于去重

View Source
var TASK_WAIT_CHANNEL = make(chan string, 10)

等待队列

Functions

func AddUser

func AddUser()

func AppendLog

func AppendLog(taskId string, taskLogId string, text string)

func AppendTask

func AppendTask(taskId string) error

func ChangeTaskStatus

func ChangeTaskStatus(taskId string, status bool) error

func Consumer

func Consumer()

func InitCron

func InitCron()

初始化定时任务

func ReadLog

func ReadLog(taskId string, taskLogId string) string

func StartTask

func StartTask(taskId string, cronExpress string) error

func StopTask

func StopTask(taskId string)

func TaskRunner

func TaskRunner(taskId string)

Types

type JobParams

type JobParams struct {
	TaskId   string `json:"taskId"`
	Cron     string `json:"cron" `
	Url      string `json:"url" `
	Title    string `json:"title" `
	RunnerId string `json:"runnerId" `
	Method   string `json:"Method" `
}

Jump to

Keyboard shortcuts

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