Documentation ¶
Overview ¶
Package job provides the Job type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrJobStarted = errors.New("Job has been started already") ErrJobNotStarted = errors.New("Job has not been started") ErrInvalidOption = errors.New("Invalid Option") )
Various predefine error values:
ErrJobStarted indicates that a Job could not be started because it had started already.
ErrJobNotStarted indicates that an operation failed because the Job has not been started yet.
ErrInvalidOption indicates that the Options used for the Job contain an invalid value.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Options ID int64 TimeSubmitted time.Time TimeStarted time.Time TimeEnded time.Time ExitCode int Cmd []string SpoolOut string SpoolErr string PID int64 // contains filtered or unexported fields }
Job is a batch job, submitted for execution. ID is an integer value that is used to uniquely identify Job instances
Options is of type Options, see there for further reference.
TimeSubmitted is the time the Job was submitted to the queue. To be filled in by the Job queue or scheduler.
TimeStarted and TimeEnded are the times at which the Job was started and ended, to be filled in by the scheduler or monitor.
ExitCode is the exit code given by the operating system.
Cmd is the array of arguments, the first element is the command itself, followed by parameters/arguments.
SpoolOut and SpoolErr are the names of the files where the output of the Job is stored, again to be filled in by the scheduler.
proc (private) is a handle to process while it is running.
func New ¶
New creates a new Job instance with the given options and command line.
Currently, the error value returned is always nil, but in the future, this might change.