job

package
v0.0.0-...-f7f3b86 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// Name path or program name to execute
	Name string `json:"name"`
	// Args arguments to send to the program/path
	Args []string `json:"args"`
}

Command command used to invoke the job

type Job

type Job struct {
	// ID unique identifier for the job
	ID string
	// Cmd command pipeline
	Cmd *exec.Cmd
	// Output output of the job
	Output []byte
	// Process details of the process spawned by the job
	Process *Process
	// StartTime start time of the job
	StartTime time.Time
	// EndTime end time of the job
	EndTime time.Time
}

Job details of the job

func (*Job) IsRunning

func (j *Job) IsRunning() bool

IsRunning returns true if the job is running

type Process

type Process struct {
	// PID process idententifier
	PID int `json:"pid"`
	// ExitCode exit code of the process
	ExitCode int `json:"exit_code"`
	// Status readable enum of the process status
	Status Status `json:"status"`
}

Process details of the process spawned by the job

type Status

type Status int

Status enum for the status of the job

const (
	// TERMINATED status for a job that has completed
	TERMINATED Status = iota
	// RUNNING status for a job that is currently running
	RUNNING
	// STOPPED status for a job that has been stopped
	STOPPED
	// UNKNOWN status for a job that has an unknown status
	UNKNOWN
)

func (Status) EnumIndex

func (s Status) EnumIndex() int

EnumIndex returns the index of the enum

func (Status) String

func (s Status) String() string

String implements the Stringer interface for the Status enum

Jump to

Keyboard shortcuts

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