handleJobs handles requests for jobs
(w http.ResponseWriter, r *http.Request)
| 1412 | |
| 1413 | // handleJobs handles requests for jobs |
| 1414 | func handleJobs(w http.ResponseWriter, r *http.Request) { |
| 1415 | w.Header().Set("Content-Type", "application/json") |
| 1416 | |
| 1417 | switch r.Method { |
| 1418 | case "GET": |
| 1419 | handleGetJobs(w, r) |
| 1420 | case "PUT": |
| 1421 | handlePutJob(w, r) |
| 1422 | case "DELETE": |
| 1423 | handleDeleteJob(w, r) |
| 1424 | case "POST": |
| 1425 | handlePostJob(w, r) |
| 1426 | default: |
| 1427 | http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) |
| 1428 | } |
| 1429 | } |
| 1430 | |
| 1431 | func handleGetJobs(w http.ResponseWriter, r *http.Request) { |
| 1432 | // Parse crontabs |
nothing calls this directly
no test coverage detected