Documentation ¶
Index ¶
- Variables
- func BuildURLForArtifact(a *Artifact) (string, error)
- func EnqueueJob(name string, parameters map[string]string, priority int, userID int) (int64, error)
- func GetResultForJob(job *Job) (string, error)
- func Init() error
- func InsertResult(tx *sql.Tx, job *Job, data string) error
- func MarkJobCompleted(tx *sql.Tx, job *Job) error
- func MarkJobFailed(tx *sql.Tx, job *Job) error
- func MarkJobStarted(job *Job) error
- func UploadArtifact(name string, f fs.File, job *Job) error
- type Artifact
- type Job
- type JobSpec
- type JobSpecParameter
- type JobSpecParameterType
- type JobStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sql.DB
View Source
var ErrNotFound = errors.New("data: not found")
Functions ¶
func BuildURLForArtifact ¶
func EnqueueJob ¶
func GetResultForJob ¶
func MarkJobStarted ¶
Types ¶
type Artifact ¶
type Artifact struct { ID int `json:"id"` Name string `json:"name"` MIME string `json:"mime"` Size int64 `json:"size"` UUID string `json:"uuid"` Created int64 `json:"created"` JobID int `json:"jobID"` }
func GetArtifactByID ¶
func GetArtifactsForJob ¶
type Job ¶
type Job struct { ID int `json:"id"` Status JobStatus `json:"-"` StatusText_ string `json:"status"` Priority int `json:"priority"` Name string `json:"name"` Parameters map[string]string `json:"parameters"` Created int `json:"created"` Started *int `json:"started"` Completed *int `json:"completed"` UserID int `json:"userID"` }
func GetJobByID ¶
func GetNextJobInQueue ¶
type JobSpec ¶
type JobSpec struct { Command string Arguments []string WorkingDirectory string PreserveEnvVars []string Timeout duration Parameter []JobSpecParameter }
func ParseJobSpec ¶
type JobSpecParameter ¶
type JobSpecParameter struct { Name string Type JobSpecParameterType }
func (*JobSpecParameter) CheckValidType ¶
func (p *JobSpecParameter) CheckValidType() error
func (*JobSpecParameter) ParseValue ¶
func (p *JobSpecParameter) ParseValue(value string) (string, bool)
type JobSpecParameterType ¶
type JobSpecParameterType string
const ( JobSpecParameterTypeString JobSpecParameterType = "string" JobSpecParameterTypeInt JobSpecParameterType = "int" )
Click to show internal directories.
Click to hide internal directories.