Documentation ¶
Index ¶
Constants ¶
View Source
const ( JobStatusCreated = "created" JobStatusQueued = "queued" JobStatusDone = "done" )
Job status
View Source
const ( QueueNameJobs = "puppet-master-jobs" QueueNameJobResults = "puppet-master-job-results" )
Job queue names
View Source
const ( ContentTypeHeader = "Content-Type" ContentTypeJSON = "application/json" )
HTTP header constants
View Source
const (
LogFieldJobID = "job_id"
)
Logger field names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONTime ¶
JSONTime handles parsing and formatting timestamps according the ISO8601 standard
func (JSONTime) MarshalJSON ¶
MarshalJSON formats the timestamp as JSON
type Job ¶
type Job struct { UUID string `json:"uuid"` Rev string `json:"_rev,omitempty"` Code string `json:"code"` Status string `json:"status"` Vars map[string]string `json:"vars"` Modules map[string]string `json:"modules"` Error string `json:"error"` Logs []Log `json:"logs"` Results map[string]interface{} `json:"results"` CreatedAt JSONTime `json:"created_at"` StartedAt *JSONTime `json:"started_at"` FinishedAt *JSONTime `json:"finished_at"` Duration int `json:"duration"` }
A Job is executed by the executor and stored in the database and holds all information required to let the puppets dance in the browser
type JobResponse ¶
type JobResponse struct {
Data *Job `json:"data"`
}
JobResponse is the wrapper around a job when returned through API
type JobResult ¶
type JobResult struct { UUID string `json:"uuid"` Error string `json:"error"` Logs []Log `json:"logs"` Results map[string]interface{} `json:"results"` StartedAt *JSONTime `json:"started_at"` FinishedAt *JSONTime `json:"finished_at"` Duration int `json:"duration"` }
A JobResult is emitted after a worker did the job and synced to database
type JobsResponse ¶
type JobsResponse struct {
Data []*Job `json:"data"`
}
JobsResponse is the wrapper around a list of jobs when returned through API
Click to show internal directories.
Click to hide internal directories.