tasks

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigDescriptiveInfo

type ConfigDescriptiveInfo struct {
	Shell string  `yaml:"shell"`
	Tasks []*Task `yaml:"tasks"`
}

ConfigDescriptiveInfo

func LoadTasks

func LoadTasks(configFileName string, allowedTasks *map[string]bool) (*ConfigDescriptiveInfo, error)

func (*ConfigDescriptiveInfo) InitTasks

func (di *ConfigDescriptiveInfo) InitTasks(allowedTasksMap *map[string]bool) []error

type Scheduler

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

func NewScheduler

func NewScheduler() (*Scheduler, error)

func (*Scheduler) AddTasks

func (s *Scheduler) AddTasks(taskList []*Task) error

func (*Scheduler) Start

func (s *Scheduler) Start() error

func (*Scheduler) Stop

func (s *Scheduler) Stop() error

type Task

type Task struct {
	Name              string   `yaml:"name"`
	Crontab           string   `yaml:"crontab"`
	Dir               string   `yaml:"dir"`
	UseShell          bool     `yaml:"useShell"`
	Command           string   `yaml:"cmd"`
	Args              []string `yaml:"args"`
	Deadline          uint32   `yaml:"deadline"`
	UseSystemEnv      *bool    `yaml:"useSystemEnv,omitempty"`
	ConcurrencyPolicy string   `yaml:"concurrencyPolicy"`
	ForceOutput       *bool    `yaml:"forceOutput,omitempty"`

	// allowed to run of not
	Enabled bool
	// contains filtered or unexported fields
}

func (*Task) Run

func (t *Task) Run()

Jump to

Keyboard shortcuts

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