MCPcopy Index your code
hub / github.com/aptly-dev/aptly / apiTasksShow

Function apiTasksShow

api/task.go:80–96  ·  view source on GitHub ↗

@Summary Get Task Info @Description **Return task information for a given ID** @Tags Tasks @Produce plain @Param id path int true "Task ID" @Success 200 {object} task.Task @Failure 500 {object} Error "invalid syntax, bad id?" @Failure 404 {object} Error "Task Not Found" @Router /api/tasks/{id} [get]

(c *gin.Context)

Source from the content-addressed store, hash-verified

78// @Failure 404 {object} Error "Task Not Found"
79// @Router /api/tasks/{id} [get]
80func apiTasksShow(c *gin.Context) {
81 list := context.TaskList()
82 id, err := strconv.ParseInt(c.Params.ByName("id"), 10, 0)
83 if err != nil {
84 AbortWithJSONError(c, 500, err)
85 return
86 }
87
88 var task task.Task
89 task, err = list.GetTaskByID(int(id))
90 if err != nil {
91 AbortWithJSONError(c, 404, err)
92 return
93 }
94
95 c.JSON(200, task)
96}
97
98// @Summary Get Task Output
99// @Description **Return task output for a given ID**

Callers

nothing calls this directly

Calls 4

AbortWithJSONErrorFunction · 0.85
TaskListMethod · 0.80
GetTaskByIDMethod · 0.80
ByNameMethod · 0.45

Tested by

no test coverage detected