MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / handleJobs

Function handleJobs

cmd/dash.go:1414–1429  ·  view source on GitHub ↗

handleJobs handles requests for jobs

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

1412
1413// handleJobs handles requests for jobs
1414func 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
1431func handleGetJobs(w http.ResponseWriter, r *http.Request) {
1432 // Parse crontabs

Callers

nothing calls this directly

Calls 5

handleGetJobsFunction · 0.85
handlePutJobFunction · 0.85
handleDeleteJobFunction · 0.85
handlePostJobFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected