taskrunner

package
v0.0.0-...-fb66a68 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrJobNotFound

type ErrJobNotFound struct{}

func (*ErrJobNotFound) Error

func (e *ErrJobNotFound) Error() string

type Job

type Job struct {
	Id          uint   `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Script      Script `json:"script"`
}

func NewJob

func NewJob(id uint, name string, description string, script Script) (*Job, error)

func (*Job) NewJobRun

func (job *Job) NewJobRun(trigger TriggerType) *JobRun

type JobRun

type JobRun struct {
	Id             uint64      `json:"id"`
	State          JobRunState `json:"status"`
	StartTimestamp int64       `json:"startTimestamp"`
	EndTimestamp   int64       `json:"endTimestamp,omitempty"`
	Trigger        TriggerType `json:"trigger"`
	Job            *Job        `json:"-"`
	Pid            *int        `json:"pid"`      // nil for not started
	ExitCode       *int        `json:"exitCode"` // nil for not started
}

type JobRunState

type JobRunState int
const (
	JOB_RUN_STATE_UNKNOWN JobRunState = iota
	JOB_RUN_STATE_FAILED
	JOB_RUN_STATE_SUCCESS
	JOB_RUN_STATE_IN_PROGRESS
	JOB_RUN_STATE_NOT_STARTED
)

func (JobRunState) IsFinished

func (e JobRunState) IsFinished() bool

func (JobRunState) String

func (e JobRunState) String() string

type Script

type Script string

type TriggerType

type TriggerType string

Jump to

Keyboard shortcuts

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