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

Function apiTasksDetailShow

api/task.go:134–150  ·  view source on GitHub ↗

@Summary Get Task Details @Description **Return task detail for a given ID** @Tags Tasks @Produce json @Param id path int true "Task ID" @Success 200 {object} string "Task detail" @Failure 500 {object} Error "invalid syntax, bad ID?" @Failure 404 {object} Error "Task Not Found" @Router /api/tasks/{i

(c *gin.Context)

Source from the content-addressed store, hash-verified

132// @Failure 404 {object} Error "Task Not Found"
133// @Router /api/tasks/{id}/detail [get]
134func apiTasksDetailShow(c *gin.Context) {
135 list := context.TaskList()
136 id, err := strconv.ParseInt(c.Params.ByName("id"), 10, 0)
137 if err != nil {
138 AbortWithJSONError(c, 500, err)
139 return
140 }
141
142 var detail interface{}
143 detail, err = list.GetTaskDetailByID(int(id))
144 if err != nil {
145 AbortWithJSONError(c, 404, err)
146 return
147 }
148
149 c.JSON(200, detail)
150}
151
152// @Summary Get Task Return Value
153// @Description **Return task return value (status code) by given ID**

Callers

nothing calls this directly

Calls 4

AbortWithJSONErrorFunction · 0.85
TaskListMethod · 0.80
GetTaskDetailByIDMethod · 0.80
ByNameMethod · 0.45

Tested by

no test coverage detected