TARGET ////// SortHandler is the handler called for the HTTP endpoint /v1/sort.
(w http.ResponseWriter, r *http.Request)
| 330 | |
| 331 | // SortHandler is the handler called for the HTTP endpoint /v1/sort. |
| 332 | func SortHandler(w http.ResponseWriter, r *http.Request) { |
| 333 | apiItems, err := checkRESTItems(w, r, 1, apc.URLPathdSort.L) |
| 334 | if err != nil { |
| 335 | return |
| 336 | } |
| 337 | |
| 338 | switch apiItems[0] { |
| 339 | case apc.Init: |
| 340 | initSortHandler(w, r) |
| 341 | case apc.Start: |
| 342 | startSortHandler(w, r) |
| 343 | case apc.Records: |
| 344 | recordsHandler(Managers)(w, r) |
| 345 | case apc.Shards: |
| 346 | shardsHandler(Managers)(w, r) |
| 347 | case apc.Abort: |
| 348 | abortSortHandler(w, r) |
| 349 | case apc.Remove: |
| 350 | removeSortHandler(w, r) |
| 351 | case apc.List: |
| 352 | listSortHandler(w, r) |
| 353 | case apc.Metrics: |
| 354 | metricsHandler(w, r) |
| 355 | case apc.FinishedAck: |
| 356 | finishedAckHandler(w, r) |
| 357 | default: |
| 358 | cmn.WriteErrMsg(w, r, "invalid path") |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | // initSortHandler is the handler called for the HTTP endpoint /v1/sort/init. |
| 363 | // It is responsible for initializing the dSort manager so it will be ready |
nothing calls this directly
no test coverage detected