jobmanager

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JobRun

func JobRun(jobId string) error

func JobStop

func JobStop(jobId string) error

func Reg

func Reg(fileData []byte)

func RegByUserConfig added in v0.0.5

func RegByUserConfig() error

func RunStartTime

func RunStartTime() time.Time

func RunTask

func RunTask(taskId string) error

func StopAll added in v0.0.4

func StopAll()

Types

type BaseConfig

type BaseConfig struct {
	Dashboard struct {
		Port int `json:"port"`
	} `json:"dashboard"`
}

func GetHttpConfig

func GetHttpConfig() BaseConfig

type Job

type Job struct {
	JobName string     `json:"jobName"`
	BinPath string     `json:"binPath"`
	Params  []string   `json:"params"`
	Dir     string     `json:"dir"`
	Timer   bool       `json:"timer"`
	Spec    string     `json:"spec"`
	Run     bool       `json:"run"`
	Options RunOptions `json:"options"` // 运行选项
}

type JobConfig

type JobConfig struct {
	ResidentTask  []Job      `json:"residentTask"`
	ScheduledTask []Job      `json:"scheduledTask"`
	Config        BaseConfig `json:"config"`
}

type JobListManager

type JobListManager struct {
	// contains filtered or unexported fields
}

type JobStatus

type JobStatus struct {
	Status  RunStatus `json:"status"`
	Name    string    `json:"name"`
	OpenRun bool      `json:"openRun"`
	Type    int       `json:"type"` // 1 是job 2是 task
}

func JobList

func JobList() []JobStatus

func TaskList

func TaskList() []JobStatus

type OutputType

type OutputType int
const (
	OutputTypeStd  OutputType = iota // 输出到标准输入输出
	OutputTypeFile                   // 输出到文件
)

type RunOptions

type RunOptions struct {
	OutputType  OutputType `json:"outputType"`  // 输出方式
	OutputPath  string     `json:"outputPath"`  // 输出路径
	MaxFailures int        `json:"maxFailures"` // 最大失败次数
}

type RunStatus

type RunStatus int
const (
	Stop RunStatus = iota
	Running
)

func (RunStatus) String

func (d RunStatus) String() string

Jump to

Keyboard shortcuts

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