tasks

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Waiting int = iota
	Interrupted
	Failed
	Ready
	Succeeded
)

Variables

View Source
var CommandTypes = []string{"", "sh", "psql"}

Functions

func Time added in v0.6.2

func Time() time.Time

Types

type Action added in v0.6.2

type Action interface {
	Validate() error
	Run() (Report, []Action)
}

type Command added in v0.6.2

type Command struct {
	Text string
	Type string
	URI  string
}

func (Command) Run added in v0.6.2

func (c Command) Run() (Report, []Action)

func (Command) Validate added in v0.6.2

func (c Command) Validate() error

type FileLoader added in v0.6.2

type FileLoader struct {
	File string
	Type string
	URI  string
}

func (FileLoader) Run added in v0.6.2

func (l FileLoader) Run() (Report, []Action)

func (FileLoader) Validate added in v0.6.2

func (l FileLoader) Validate() error

type OutputLoader added in v0.6.2

type OutputLoader struct {
	Text string
	From string
	Type string
	URI  string
}

func (OutputLoader) Run added in v0.6.2

func (l OutputLoader) Run() (Report, []Action)

func (OutputLoader) Validate added in v0.6.2

func (l OutputLoader) Validate() error

type Report added in v0.6.2

type Report struct {
	Status    int
	StartTime time.Time
	EndTime   time.Time
	Elapsed   time.Duration
	Output    string
	Error     string
}

type Result

type Result struct {
	ID        int
	SubID     int
	WorkerID  int
	StartTime time.Time
	EndTime   time.Time
	Elapsed   time.Duration
	Status    int
	Output    string
	Error     string
}

type Task

type Task struct {
	ID      int
	SubID   int
	Name    string
	Action  Action
	Depends []int
	Status  int
}

func (Task) Validate

func (t Task) Validate() error

func (Task) ValidateDependencies

func (t Task) ValidateDependencies(identifiers []int) error

Jump to

Keyboard shortcuts

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