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

Function apiReposList

api/repos.go:79–99  ·  view source on GitHub ↗

@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)

Source from the content-addressed store, hash-verified

77// @Success 200 {array} localRepoResponse
78// @Router /api/repos [get]
79func 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
101type repoCreateParams struct {
102 // Name of repository to create

Callers

nothing calls this directly

Calls 6

LocalRepoCollectionMethod · 0.95
newLocalRepoResponseFunction · 0.85
AbortWithJSONErrorFunction · 0.85
NewCollectionFactoryMethod · 0.80
ForEachMethod · 0.45
LoadCompleteMethod · 0.45

Tested by

no test coverage detected