handleGetJob returns a specific job.
(w http.ResponseWriter, r *http.Request)
| 271 | |
| 272 | // handleGetJob returns a specific job. |
| 273 | func (s *Server) handleGetJob(w http.ResponseWriter, r *http.Request) { |
| 274 | id := r.PathValue("id") |
| 275 | if id == "" { |
| 276 | writeError(w, http.StatusBadRequest, "Missing job ID", "") |
| 277 | return |
| 278 | } |
| 279 | |
| 280 | job, ok := s.jobs.GetJob(id) |
| 281 | if !ok { |
| 282 | writeError(w, http.StatusNotFound, "Job not found", "") |
| 283 | return |
| 284 | } |
| 285 | |
| 286 | writeJSON(w, http.StatusOK, job) |
| 287 | } |
| 288 | |
| 289 | // handleCancelJob cancels a job. |
| 290 | func (s *Server) handleCancelJob(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected