@Summary List Repositories @Description **Get list of available repos** @Description Each repo is returned as in “show” API. @Tags Repos @Produce json @Success 200 {array} localRepoResponse @Router /api/repos [get]
(c *gin.Context)
| 77 | // @Success 200 {array} localRepoResponse |
| 78 | // @Router /api/repos [get] |
| 79 | func apiReposList(c *gin.Context) { |
| 80 | result := []localRepoResponse{} |
| 81 | |
| 82 | collectionFactory := context.NewCollectionFactory() |
| 83 | collection := collectionFactory.LocalRepoCollection() |
| 84 | err := collection.ForEach(func(r *deb.LocalRepo) error { |
| 85 | err := collection.LoadComplete(r) |
| 86 | if err != nil { |
| 87 | return err |
| 88 | } |
| 89 | |
| 90 | result = append(result, newLocalRepoResponse(r)) |
| 91 | return nil |
| 92 | }) |
| 93 | if err != nil { |
| 94 | AbortWithJSONError(c, 500, err) |
| 95 | return |
| 96 | } |
| 97 | |
| 98 | c.JSON(200, result) |
| 99 | } |
| 100 | |
| 101 | type repoCreateParams struct { |
| 102 | // Name of repository to create |
nothing calls this directly
no test coverage detected